Preferred way of changing icon?


#1

hello,

i want to make a star / unstar feature. how is the preferred way of changing a item.

$$(document).find('.favLink .f7-icons').html('new_icon_name');

seems not working right


#2

Use .text() instead of .html()


#3

If it doesn’t work then probably icon selector is wrong


#4

okay i found out that you cant use a icon with “underscore” in name.
so you have use

<i class="material-icons md-only">&#xE83A;</i>

insead of

<i class="material-icons md-only">star_border</i>

and “Use .text() instead of .html()” seems to be wrong because you need

$$(document).find('.favLink .material-icons').html('&#xE83A;');

else he will not translate it