Click here to Skip to main content
15,881,882 members
Please Sign up or sign in to vote.
2.00/5 (2 votes)
See more:
Why are these functions not working?

HTML
<!DOCTYPE html>
	<head>
		<body>
			<script>
            	function function1() {
            		alert("ka");
            	}
            	function function2() {
            		alert("he");
            	}
            	function function3() {
            		alert("f");
            	}
			</script>
			

			<button onclick="function1">button1</button>
			<button onclick="function2">button2</button>
			<button onclick="function3">button3</button>
		</body>
	</head>
Posted
Updated 27-Mar-15 16:07pm
v2

1 solution

Write like this...
XML
<button onclick="function1()">button1</button>
<button
 
Share this answer
 
Comments
Afzaal Ahmad Zeeshan 27-Mar-15 22:06pm    
+5 for the catch!
Thanks Afzaal. :)
Sergey Alexandrovich Kryukov 27-Mar-15 22:32pm    
Correct, a 5.
—SA
Thanks Sergey. :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900