Reputation: 15733
codes:
var jqueryObj=$("#readme");
alert(jqueryObj.length); // result == 0
can i get "#readme" from jqueryObj ? like:
alert(jqueryObj.selector); //i want get "#readme"
BTW: i want to get selector,not element ID, and jqueryObj.length == 0.
Upvotes: 3
Views: 431
Reputation: 990
Edit: Deleted 'half a page of incorrect code' due to endless discussion. Refer to decezes answer for complete solution ...
Upvotes: 1
Reputation: 2096
$('#ggggg').selector
is the correct way of getting the selector for the jQuery object.
This is what you had in your original post, have you tried it?
Upvotes: 0