why can't I use & in value in html? I want to display '&' sign. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

why can't I use & in value in html? I want to display '&' sign.

Eg. <input value=''a &amp; b.''>

3rd Jan 2018, 9:06 AM
John Michael
John Michael - avatar
3 Answers
+ 8
the attribute value us not in HTML format, so use normal '&' character will do the job.
3rd Jan 2018, 9:08 AM
Calviղ
Calviղ - avatar
+ 2
you can use it like for ampersand &#38; (it's respective hexcode) or the html code &amp; i tested both values and its Working fine
3rd Jan 2018, 10:13 AM
Мг. Кнап🌠
Мг. Кнап🌠 - avatar
0
ohh. hehe. I overthought it. hehe. Thanks ya
3rd Jan 2018, 9:11 AM
John Michael
John Michael - avatar