How to clear <p> with Button+js ? HelpHelp | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How to clear <p> with Button+js ? HelpHelp

How to clear <p> with Button+js ? HelpHelp

27th Oct 2019, 10:32 AM
Serikov Temirlan
Serikov Temirlan - avatar
4 Answers
+ 3
Hi. 1. You have to create a function in js. 2. Write document.getElementById("id of your p").innerText=""; inside of the function. 3. Add an onclick event to the button. 4. Test it. This should work.
27th Oct 2019, 12:01 PM
🍇 Alex Tușinean 💜
🍇 Alex Tușinean 💜 - avatar
+ 1
^up.
27th Oct 2019, 10:33 AM
Serikov Temirlan
Serikov Temirlan - avatar
0
Thx
27th Oct 2019, 12:02 PM
Serikov Temirlan
Serikov Temirlan - avatar
0
The work it.
27th Oct 2019, 12:02 PM
Serikov Temirlan
Serikov Temirlan - avatar