Knowledge Walls
Hyderabad, Andhra Pradesh, India
Quotes in HTML attribute value in UI Issues of WEB UI Tips and Tricks
How to add special characters in html attribute values? 
Special characters making problem while adding with attribute values in HTML.

Double quotes - "
Single quotes - '
And operators - &
Lessthan operator - <

Characters should get encoded in attribute value.

Example: Wrong value
<div data="example"data">Data</div>

Should use
<div data="example&quot;data">Data</div>
Function to do encode
function encodeHTML(s) {
    return s.split('&').join('&amp;')
Previous Topics
Previous lessons of current book.
Best Lessons of "WEB UI Tips and Tricks"
Top lessons which are viewed more times.
  Copyright © 2014 Knowledge walls, All rights reserved
keep your tutorials and learnings with KnowledgeWalls. Don't lose your learnings hereafter. Save and revise it whenever required.
Click here for more details