I'm trying to pass 2 variable using onClick inside of <a> tag
Here's my code:
<a onClick="pbDiv(id=1);">Enter</a>
<script>
function pbDiv(id){
alert(id);
}
</script>
This works perfectly as it should be.
But the problem is I need to pass 2 variable
Example of variable
id=1
name=myname
inside of onClick
Is that even possible?
tried this one onClick="pbDiv(id=1,name=name);"
seems not working to me.
pbDiv(1, 'foo')But even better, avoid inline listeners entirelyid)