0
Is "func" same as "function" while using the onclick event to handle html in js?
2 Antworten
+ 2
No, function is a reserve keyword to declare a function where as func is an identifier or Name that can be used as function name. So if you want to call function in onclick use function name that is:
JS:
function func(){
alert("trial");
}
HTML:
<button onclick="func()">try me</button>
+ 1
I understand that now. Thanks a lot