0

I tried the following code, but it did not work to set the input field to have the value " . Does anyone have any idea how to set it.

<input type="text" name="fname" value="\""><br>
Liam
  • 27,717
  • 28
  • 128
  • 190

2 Answers2

4

use &quot; HTML designed work like this.

<input type="text" name="fname" value="&quot;">
Just code
  • 13,553
  • 10
  • 51
  • 93
1

" (Double Quote) is not a ASCII Character. Browser can not render an Non-ASCII Character (if you have to press any key or any combination of keys except shift key to build a character).

Now you have to use HTML Character Entity Name &quot; or Entities Number &#34; or Entity Construct Encode &#x00022; for the Double Quote character. Please see the following code:

<!-- Entity Name -->
<input type="text" name="fname" value="&quot;"><br>
<!-- Entity Number -->
<input type="text" name="fname" value="&#34;"><br>
<!-- Entity Construct Encode -->
<input type="text" name="fname" value="&#x00022;">

More about HTML Character Entities.
Complete cheat-sheet of HTML Character Entities

johirpro
  • 509
  • 4
  • 16