Declaring a parameter in html and receiving it in Javascript -
my js function goes this:
function tester (message) { alert(message); }
and in markup have:
<a href="#" onclick="tester(text show);">link</a>
but doesn't work. can please tell me why?
text show
not string unless wrap quotes, either single or double.
like this:
<a href="#" onclick="tester('text show');">link</a>
notice can't use same kind of quote both javascript code , html.
your code giving errors. check console when code doesn't expect to.
Comments
Post a Comment