3 ms·
A simple way is to create a new element in memory and set it's text property and then retrieve it's html. Using jQuery: $('<div/>').text('A & B').html();
by mrduncan 17y ago
A simple way is to create a new element in memory and set it's text property and then retrieve it's html.
Using jQuery:
$('<div/>').text('A & B').html(); // "A & B"