How to have quotation marks in HTML input values

escaping, html

Solution

Yes, using `"` works:

<input type="text" name="last_name" value="&quot;My quote!&quot;" />

Problem

I have the following problem - from the server side I get a string like 'hoschi"brother'. I want to put this string into a `<input value"MYSTRING" />`. This results in something like `<input value"hoschi" brother" />` which obviously does not work. Is there a workarounds for this? Does escaping the `"` character with `&quot;` work within the value tag?

Original source

Related problems