jquery イベントで 1 つのリスト項目から矢印アイコンを削除しようとしています。
1 つのリスト項目:
<li class='message_list'><a id='message_list_item' href='#'>
<h3>Sender</h3>
<p><strong>Subject</strong></p>
<p>Body Text</p>
<p class='ui-li-aside'><strong>Time</strong>am</p>
</a></li>
脚本:
$(".message_list").swipeleft(function(event) {
event.stopImmediatePropagation(); //prevent from firing twice
$(this).attr('data-icon', 'false');
$("#test_display").html("Worked");
return false;
});
テスト html が更新されるため、スクリプトがアクティブになります。しかし、なぜその属性の変更が機能しないのでしょうか?
しかし、置く<li data-icon='false' class='message_list'>
ことはそれを取り除きます!