0
我正在開發一個JavaScript和jQuery應用程序。在應用程序中,有一些listview
(jQuery手機)和一些項目。動態刪除數據圖標
我已經做了功能動態消除在listview
項的所有數據圖標,但它不工作:
$(".lvItem").each(function() {
$(this).attr('data-icon', 'false');
$(this).find('.ui-icon').removeClass('ui-icon-' + 'arrow-r');
});
但是,如果我嘗試動態地更改圖標,它完美:
$(".lvItem").each(function() {
$(this).attr('data-icon', 'arrow-u');
$(this).find('.ui-icon').addClass('ui-icon-' + 'arrow-u');
$(this).find('.ui-icon').removeClass('ui-icon-' + 'arrow-r');
});
我在做什麼錯?