attr()和text和val和css()

attr()用于设置元素的属性

$('input').attr('type','password')

text()用于设置元素的文本内容

 $('.box > span').text(a)

val()用于设置文本框的内容

 $('input').val(a)

css() 用于改变元素的样式

 $('.box').css('color','red')

猜你喜欢

转载自www.cnblogs.com/libainian/p/13205491.html