Please read the following notes first

how to get html element id using javascript?

question.user.is_active : Asked by hengzhong on Nov. 17, 2022, 1:17 a.m.

i am trying to alert the id of a div when clicking on an image inside it as code is: .test1{ width:500px; background: #cc0000; color:#fff; height:200px; margin:0px auto; } function hidediv(){ var a = document.getElementById("divtobehide"); alert(a); } This is the div to be hiddenite here the alert box appears but the id is not displayed. how to solve this?

Prior Answers

Login to this site to post your answers

Go Back to Front Page