The element is:
<input type="text" name="idName" id="idName" value="" size="2" maxlength="2" />
I use this selector:
alert($('#idName').val());
In IE 8:
cannot alert the content
In IE 9 and firefox 8:
can alert the content
why? How to fix?
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.
Make sure the code that calls the
alert($('#idName').val());is inside a$(document).ready(function(){..});part, so that it runs after the DOM is ready..