Following line doesn’t work in FF 5.
<a href="javascript:func1(upDiv);">Resend Pin</a>
<div id="upDiv">ASDFGHJKL</div>
JS function
function func1(windowname) {
alert(windowname);
}
It works in Google Chrome and even in IE8.
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.
IE and Chrome have the (bad) habit of creating a global variable for each element with an ID which refers to that element.
Pass a string and use
getElementByIdinstead:Also, don’t use the
javascript:pseudo protocol. Either refer to a proper location so that it works if JS is disabled or use a button, and attach an event handler for theclickevent. E.g.You can style the button as a link if you really want to.