var jqueryObj=$("#readme");
alert(jqueryObj.length); // result == 0
我可以得到 「#readme」 從jqueryObj? 像:
alert(jqueryObj.selector); //i want get "#readme"
BTW:我想選擇,不元素的ID,並jqueryObj.length == 0
var jqueryObj=$("#readme");
alert(jqueryObj.length); // result == 0
我可以得到 「#readme」 從jqueryObj? 像:
alert(jqueryObj.selector); //i want get "#readme"
BTW:我想選擇,不元素的ID,並jqueryObj.length == 0
呃... ...你試過嗎? http://api.jquery.com/selector/
$('#ggggg').selector
是獲取jQuery對象選擇器的正確方法。
這是你在原來的文章中,你有沒有嘗試過嗎?
編輯:由於無休止的討論,刪除了'半個不正確的代碼頁'。參考decezes回答完整的解決方案...
你爲什麼要那樣做?您必須先選擇一個元素,然後才能對其執行操作。所以,alert('jQueryObj')'必須已經被選中了。 – jAndy 2010-06-21 07:38:34
有趣。在你的問題和你的代碼中,你正在尋找你已經擁有的東西...... – Kobi 2010-06-21 07:44:49