<p onclick="myFunction()"> - Javascript DOM Event

Javascript examples for DOM Event:onclick

Description

<p onclick="myFunction()">

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<p id="demo" onclick="myFunction()">Click me.</p>

<script>
function myFunction() {/*from ww  w .  j  a v a  2s.co m*/
    document.getElementById("demo").innerHTML = "YOU CLICKED ME!";
}
</script>

</body>
</html>

Related Tutorials