onlyforbopi
9/19/2018 - 12:08 PM

JS.Events.ChangingButtonContentInline

JS.Events.ChangingButtonContentInline

JS.Events.ChangingButtonContentInline

A Pen by Pan Doul on CodePen.

License.

<!DOCTYPE html>
<html>
<body>

<!-- Adding inline jaavscript on button, onclick event-->
  <!-- Date() is a default function -->
<button onclick="document.getElementById('demo').innerHTML=Date()">The time is?</button>

<!-- Adding inline javascript on button, on click event-->
<!-- Using this.innerHTML to affect the button-->
<button onclick="this.innerHTML = Date()">The time is?</button>
  
<p id="demo"></p>

</body>
</html>