Click the yellow Thoken Pay button below to pay for reading the entire article. Or click the blue Thoken link in the answer text to tip the author.
Payments are usually just a click away.
However, you will need to enter your email (or phone number with country code) and password (or short key) for your Thoken account if: (i) it is the first time you use Thoken on a device and a browser; or (ii) you have not used Thoken to make payments on the device and the browser for a long time.
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
#1: This is another way you want to try.
Please
Click Thoken to offer a token of your thanks.
Answered by thoken.user@gmail.com on Feb. 18, 2023, 12:46 a.m.
#2: Here is the way you might want to follow.
Click Thoken to offer a token of your thanks.
Answered by hengzhong on Feb. 18, 2023, 12:37 a.m.