Javascript操作元素属性方法总结
时间:2014-06-02 01:25:59
收藏:0
阅读:199
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 |
<!DOCTYPE html><head><meta http-equiv="Content-Type"
content="text/html; charset=utf-8"/> <title></title></head><body> <!-- 元素属性的操作 第一种:oDiv.style.display="none"; 第二种:oDiv.style["display"]="none"; 第三种:Dom方式 Dom方式操作元素的属性 获取:getAttribute(名称);//99%一般用不着他 设置:setAttribute(名称,值); 删除:removeAttribute(名称); --></body></html> |
评论(0)