I'm using Javascript to pull a value out from a hidden field and display it on a textbox
The value in the hidden field is encoded.
e.g.
<input id='hiddenId' type='hidden' value='chalk & cheese' />
gets pulled into
<input type='text' value='chalk & cheese' />
via some JQuery to get the value from the hidden field (Its at this point that I lose the encoding)
$('#hiddenId').attr('value')
The problem is when I read chalk & cheese from the hidden field, javascript seems to lose the encoding, but to escape " and ' I want the encoding to remain.
Is there a Javascript library or a Jquery method that will Html Encode a string?