On html page if I give name in double quotes then it is not getting reflected on page. It displays a blank string. I tried with escape() function but that didn\'t work. So w
var str = 'My "String"'; //use single quotes for your string
var str = "My \"String\""; //escape your doublequotes
var str = "My "String""; //use it as html special chars