List view items accommodate <a>
tags which hold icons. data-icon
attribute is deprecated and replaced with icon classes to be added directly into <a>
tags.
However, in list view items, icon classes are added once list view is created. To change icon of a li
, you need to add it directly into li
's anchor.
$("li a").addClass("ui-icon-check");
Moreover, you need to remove previous icon's class. It can be done programmatically this way.
$(".selector a").removeClass(function (i, uiClass) {
return (uiClass.match(/\bui-icon-\S+/g) || []).join(' ');
}).addClass("ui-icon-check");
This will remove current icon and replaces it with ui-icon-check
.