これが私のhtmlです:
<ul class="inboxList">
<li data-selecttype='global|mailbox|inbox'>Inbox</li>
</ul>
そして、ここに私のjqueryコードがあります:
$(".inboxList").children().each(function(child){
console.log($(child).data("selecttype"));
});
また、子で $() を取り出してみました:
$(".inboxList").children().each(function(child){
console.log(child.data("selecttype"));
});
しかし、それはうまくいきませんでした。
私の戻り値は null で未定義です。戻り値が次のようになることを期待していましたglobal|mailbox|inbox
。
助けてくれてありがとう!