In my code when I write code like:
$("#id_pop")[0]
there is an error. When I correct it to:
var $d = $("#id_pop");
$d[0]....
it’s ok. Why?
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.
[0]should work, i.e. get you a DOM object. But you can’t continue using jQuery methods once you get back a normal DOM object.you can also get a DOM object from a jQuery selector like this:
$('#id_pop').get(0);Also are you sure you only have one element with the id
id_pop. If there is then$('#id_pop')[0]should work.See working example here: http://jsbin.com/udace3