jQuery基础 DOM操作

 

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

 $("#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

posted @ 2017-02-11 19:00  游称  阅读(96)  评论(0编辑  收藏  举报