您的位置:首页 > Web前端 > JQuery

JQuery自学记录3——对页面内容及样式的操作

2012-09-24 10:50 225 查看
1、对HTML内容改变

$(selector).html(content):改变对象的html内容为content

$(selector).append(content):在对象的html内容后添加content

$(selector).prepend(content):在对象的html内容之前添加content

$(selector).after(content):在对象的标签之后添加内容content

$(selector).before(content):在对象的标签之前添加内容content

还有很多,详见:http://www.w3school.com.cn/jquery/jquery_ref_manipulation.asp

2、对CSS样式的改变

$(selector).css(name,value):设置对象css为name的值为value

$(selector).css({properties}):设置对象css样式为properties

$(selector).css(name):返回对象css为name的值

$(selector).height(value):设置对象height值

$(selector).width(value):设置对象width值

还有一些,详见:http://www.w3school.com.cn/jquery/jquery_ref_css.asp
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐