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"Using jQuery:
$('<div/>').text('A & B').html(); // "A & B"No comments yet.