adding a character entity into an object in jquery
Pretty simple stuff but since I’m still a little rusty on jquery I spent a lot of time trying to get the entity to show up using text: by escaping characters. (spoiler: don’t use text: use html:
Right Way
1 2 3 4 5 6 |
$('<span></span>',{ html: '&oplus; ', class: 'plus-minus' }).prependTo('.event-table-show-hide .expand-list .click-to-expand'); |
Wrong Way
1 2 3 4 5 6 |
$('<span></span>',{ text: '&oplus; ', class: 'plus-minus' }).prependTo('.event-table-show-hide .expand-list .click-to-expand'); |