JS运用id得到其他的属性值及jquery对相同属性的class扫描

来源:互联网 发布:win7开机还原软件 编辑:程序博客网 时间:2024/06/07 01:50

1、JS运用ID得到其他的属性值

document.getElementsById("ID值").getAttribute("所得属性名称");

2、JS运用ID改变其他属性及ID的值

document.getElementById("ID值").getAttribute("所改变属性的名称","改变后的值");

3、JQuery对相同属性的扫描

$(".所扫描class名称").each(function(){

然后通过 $(this)对象去对某一个class的子对象进行操作

})

4、
0 0
原创粉丝点击