下面的代碼在jsfiddle.net上可以運(yùn)行,在chrome和Firefox上沒反應(yīng)?IDE是WebStorme代碼一直出錯(cuò),放到j(luò)sfiddle.net上卻可以,弄到有點(diǎn)懷疑人生了...<!DOCTYPE html><html><head> <meta charset="UTF-8"> <script> function show() { var value2=document.getElementById("hello_2"); value2.style.visibility="visible"; } var value1=document.getElementById("hello_1"); value1.addEventListener("click",show,false); </script> <style> </style></head><body><button id="hello_1">hello</button><div id="hello_2" style="color: yellow;visibility: hidden">hello</div></body></html>
代碼在jsfiddle.net可以運(yùn)行,在瀏覽器上沒反應(yīng)
繁花不似錦
2019-02-15 18:15:34