84669 person learning
152542 person learning
20005 person learning
5487 person learning
7821 person learning
359900 person learning
3350 person learning
180660 person learning
48569 person learning
18603 person learning
40936 person learning
1549 person learning
1183 person learning
32909 person learning
getAttribute()和setAttribute()还是有点搞不清
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’的属性
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.
是读,从已有的属性值中读取
是写,有两个参数,先根据第一个参数查找当前元素是否有‘name’属性,如果没有就添加一个‘name’属性,然后再将第二个参数值赋给名为第一个参数值‘name’的属性