How to escape a single quote with HTML?

Spread the love

Sometimes, we want to escape a single quote with HTML.

In this article, we’ll look at how to escape a single quote with HTML.

How to escape a single quote with HTML?

To escape a single quote with HTML, we use the ' HTML entity.

For instance, we write

<input type="text" id="abc" value="hel&#39;lo" />

to set the value attribute of the input to text that includes a single quote with &#39;.

Conclusion

To escape a single quote with HTML, we use the &#39; HTML entity.

Leave a Reply

Your email address will not be published. Required fields are marked *