HTML Entities are used to display reserved characters and symbols that would otherwise be interpreted as HTML code:
- Security: It prevents Cross-Site Scripting (XSS) by ensuring user input is rendered as text, not executable script.
- Special Symbols: Easily display symbols like © (Copyright), ™ (Trademark), or € (Euro) using their entity names.
- Reserved Characters: Characters like
<and>must be converted to<and>to show up on a page.
What is the difference between Name and Number entities? +
Name entities use easy-to-remember words (like ©), while Number entities use the character's Unicode position (like ©). Both work the same in modern browsers.
No comments:
Post a Comment