getAttribute()和setAttribute()还是有点搞不清
汪汪
汪汪 2016-12-19 14:33:07
0
2
1268

getAttribute()和setAttribute()还是有点搞不清

汪汪
汪汪

reply all(2)
数据分析师

getAttribute() and setAttribute() are still a bit confusing - PHP Chinese website Q&A - getAttribute() and setAttribute() are still a bit confusing - PHP Chinese website Q&A

Take a look around and learn.

阿神
getAttribute(name)

是读,从已有的属性值中读取

setAttribute(name,value)

是写,有两个参数,先根据第一个参数查找当前元素是否有‘name’属性,如果没有就添加一个‘name’属性,然后再将第二个参数值赋给名为第一个参数值‘name’的属性

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template