How to use this code as Unobtrusively? To keep content and Behaviour separate.
<a href="nojavascript.html" onclick="functionName(); return false;"
onkeypress="functionName(); return false;">Link text</a>
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You could write it like this:
Then use jQuery’s
.bind()like this:Or alternatively, give it a class like this:
And use a
.classselector like$("a.noJS")instead to be a bit cleaner (or, if it’s unique, use an ID).