Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR HTML

html onclick attribute

<!DOCTYPE html>
<html>
<body>
	<h2>GeeksforGeeks</h2>
	<h3>onClick Event Attribute</h3>
	<span>Click the button to see the date & time.</span>
	<button onclick="getElementById('time').innerHTML= Date()">
		Show Date
	</button>
	<p id="time"></p>

</body>
</html>
Source by www.codingninjas.com #
 
PREVIOUS NEXT
Tagged: #html #onclick #attribute
ADD COMMENT
Topic
Name
8+9 =