C# Programming: How to use Javascript in HTML | Make function in Javascript | Learn HTML5

Sunday, June 24, 2018

How to use Javascript in HTML | Make function in Javascript | Learn HTML5





This video demonstrate how to use javascript in html by making function in javascript.



code:

<!DOCTYPE html>

<html>

<head>

<title>Learning Javascript</title>



<script>

  function displayTime()

  {

  document.getElementById('para1').innerHTML= Date();

  }

</script>

</head>

<body>

<h2>Learning Javascript</h2>



<button onclick="displayTime()" >Click me</button>



<p id="para1">Paragraph without change </p>

</body>

</html>

No comments:

Post a Comment