Add click event to <p> element and change its inner html - Javascript DOM

Javascript examples for DOM:Quiz

Description

Add click event to <p> element and change its inner html

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<p onclick="this.innerHTML='GOOD JOB!'">Click me.</p>

</body>/*  ww  w .  ja  v a 2 s  .c o m*/
</html>

Related Tutorials