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