当前位置: 代码迷 >> Web前端 >> Jquery惯用
  详细解决方案

Jquery惯用

热度:91   发布时间:2012-08-30 09:55:54.0
Jquery常用

修改样式

if (now == null || now == "" || now == "null") { // 注意字符串"null"
	now = "opt_11";
}
$("#"+now).css("display", "");
$("#img"+now).attr("src","images/index/close.gif");
$("#img"+now).attr("alt","收起");
?

?

1、div

?

?

// 设值
$("#div_id").text('');

// 隐藏
$("#div_id").hide();

?

2、input

?

?

// this
this.value // 取值

// 取值
$("#input_id").val()

?

3、form

?

?

// action
$("form").attr('action','').submit();
?

?

  相关解决方案