码迷,mamicode.com
首页 > Web开发 > 详细

jQuery基础 DOM操作

时间:2017-02-11 19:56:34      阅读:131      评论:0      收藏:0      [点我收藏+]

标签:设置   分享   code   技术分享   jquer   ble   png   jquery   pre   

 

技术分享

技术分享

 设置属性:只有一个参数为获取

 $("#btn1").click(function () {
        $(this).attr("disabled","disabled");
    });

移除属性:

$("#btn1").click(function () {
        $(this).removeAttr("value");
    });

设置样式:只有一个参数为选取

$("#btn1").click(function () {
        $(this).css("background-color","red");
    });

表单元素赋值:val("");取值:val();
非表单元素:innerhtml变为html;innertext变为text

jQuery基础 DOM操作

标签:设置   分享   code   技术分享   jquer   ble   png   jquery   pre   

原文地址:http://www.cnblogs.com/wy1992/p/6386760.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!