-1
我嘗試選擇ID爲「selectmethod」的「div」,但我不能!jQuery Select div ID問題
我需要做什麼?
我的HTML:
<body>
<div class="frame">
<aside class="Aside">
<section class="SelectProvider">
<div class="SelectProvider-select-container" title="">
<div class="SelectProvider-select-inlay">
<div class="SelectProvider-select-image--text"></div>
<div class="SelectProvider-select-text">Text</div>
<div id="selectmethod" class="SelectProvider-select-chrome">▾</div>
</div>
</div>
</section>
</aside>
</div>
</body>
JQ:
$("#selectmethod").click(function(){
alert($(this).attr("id"));
});
你確定了jQuery庫放置正確? – Dekel
你會得到什麼錯誤? – j08691
我不知道在這裏我發現錯誤... 是的,jquery庫正確加載 – Mihai