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

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

CSS3 Transition to highlight new elements created in JQuery -