Sometimes, we want to properly escape quotes inside HTML attributes.
In this article, we’ll look at how to properly escape quotes inside HTML attributes.
How to properly escape quotes inside HTML attributes?
To properly escape quotes inside HTML attributes, we use "
.
For instance, we write
<select>
<option value='"asd'>Test</option>
</select>
to add a select element with an option element with the value
attribute set to "asd
.
Then "
will be rendered as "
.
Conclusion
To properly escape quotes inside HTML attributes, we use "
.