Simple question, however I can’t find an answer anywhere.
I need a text input that can display HTML in it’s value i.e:
<input type="text" name="guest_sc_player" id="guest_sc_player" size="27" value="<iframe width="100%" height="166" scrolling="no" frameborder="no" src="http://w.soundcloud.com/player/?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F34196707&show_artwork=true"></iframe>" />
Most of the other answers will work for this specific situation, but the correct way to do this is to HTML Encode the entire value:
jsfiddle
This avoids the necessity of worrying whether there may be single or double quotes in the value string. Depending on what platform you’re using, there’s probably a convenience method to do this automatically. e.g. HttpUtility.HtmlEncode in .NET