亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

Alone88
Ikut

Selepas mengikuti, anda boleh menjejaki maklumat dinamiknya tepat pada masanya

Nota kursus
  • Kursus dalam bahagian yang berkaitan:Tambah, padam, ubah suai dan semak nod atribut: cara paling berkesan untuk mengawal elemen

    ## **JavaScript增刪改查** 第一種 .(點操作符) ```JavaScript 不加='',則是查看內(nèi)容,加了就是增加或修改 var h2 = document.getElementsByTagName('h2');//先定義變量 h2.ClassName ='class'//增加或修改Class的內(nèi)容 h2.Id = 'id'//增加或修改id的內(nèi)容 h2.style.color ='red' //增加或修改style的內(nèi)容,style. ``` 第二種:Attribute(屬性) ``` h2.getAttribute('屬性名')//獲取屬性; h2.setAttribute('屬性名','要修改的內(nèi)容')//修改 h2.removeAttribute('屬性或元素')//刪除 ``` 第三種:attributes ``` h2.attributes//獲取屬性 h2.attributes[索引]; h2.attributes['屬性']; h2.attributes['屬性'].nodeType='修改的內(nèi)容'//修改 h2.attributes.removeNamedItem('屬性')//刪除內(nèi)容

    2018-05-181個贊