InnerHtml can smb clarify ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

InnerHtml can smb clarify ?

13th Aug 2017, 8:22 PM
Bekturdiev Nurulla
Bekturdiev Nurulla - avatar
2 Answers
+ 3
it is DOM. Lets say there is a paragraph you want to change its content by event. <p id="priceTag" >$50</p> <button onclick="changePrice">Click</button> <script> function changePrice (){ var x = document.getElementById("priceTag"); x.innerHTML="$35"; } </script> https://code.sololearn.com/WkFu0PqDX01Y/?ref=app
13th Aug 2017, 8:38 PM
Melih Melik Sonmez
Melih Melik Sonmez - avatar
+ 2
gooD
14th Aug 2017, 5:49 AM
Bekturdiev Nurulla
Bekturdiev Nurulla - avatar