trouble injecting icon character reference into data-icon="" attribute with jqury

34 views
Skip to first unread message

greg....@gmail.com

unread,
Mar 2, 2013, 1:17:40 PM3/2/13
to ico...@googlegroups.com
Hi There

I am trying to dynamically set the data-icon attribute of an <li> using jquery. the intention is to have the icon display in li:before by setting the content:"" to content:attr(data-icon) . Unfortunately, I cant work out what code to use. Both "&#xe01e;" and "U+e024" display as they do here, even when i try using escape characters.

Any idea how to get around this?

Greg

Keyamoon

unread,
Mar 2, 2013, 2:04:20 PM3/2/13
to ico...@googlegroups.com
To escape these characters in Javascript, you need to do it like this: "\ue000"
Reply all
Reply to author
Forward
0 new messages