What I can do to show some text after clicking onto a button? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

What I can do to show some text after clicking onto a button?

6th Jan 2019, 8:31 PM
Satyam
Satyam - avatar
1 Answer
+ 6
You need JavaScript to handle click event in Html. The easiest option is writing a JavaScript function and call the function on the onclick attribute of the html. You will need some dom manipulation. document.getElementbyId which will be stored in a variable. or this <button onclick="this.innerHTML=Date()">The time is?</button> or any other element you want to use.
6th Jan 2019, 8:52 PM
africana
africana - avatar