Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

html onclick pass parameter

// if you are using onclick attribute you can write like this for example

<button type="button" onclick="myFunction('testParameter')"> Test Button</button>



<script>
 function myFunction(myString){
 	console.log(myString)
 }
</script>
 
PREVIOUS NEXT
Tagged: #html #onclick #pass #parameter
ADD COMMENT
Topic
Name
2+1 =