我這樣做的話,為何只能實(shí)現(xiàn)一次,第二次鼠標(biāo)放在標(biāo)簽上就不會(huì)再出現(xiàn)動(dòng)作。
document.getElementById("hero").onmouseover=A;
function A(){this.style.display="block"}
document.getElementById("hero").onmouseout=B;
function B(){this.style.display="none"}
2015-05-13
getElementById是錯(cuò)的?id是唯一的,所以是單數(shù),沒有s,而想class是可以多個(gè)的,所以有s(getElementsByClassName())
2015-05-12
我把getElementById改成getElementsById可以實(shí)現(xiàn)了,getElementById和getElementsById有何區(qū)別,還是說getElementById根本就是錯(cuò)的。