Answers for "how to passs event onclick to a method along with parameters in JS"

3

javascript onclick parameters

<button onclick="myfunctionName('John')">Click</button>

<script type="text/javascript">
	function myfunctionName(String){
		alert(String);
	}
</script>
<!-- Will Show an Alert Box Saying "John" -->
Posted by: Guest on May-02-2021

Code answers related to "how to passs event onclick to a method along with parameters in JS"

Browse Popular Code Answers by Language