HungryMind Posted May 15, 2011 Share Posted May 15, 2011 HiI've this line: document.getElementById("div").innerHTML = "<img src='images/close-btn.jpg' height='16' width='16' onclick='document.getElementById("div").style.display="none";' />";[code]I want to use quotation under onclick function on image.But i can't use double quotations under double quotations.And i've used single quotations too.What should i do?Please guide? Link to comment Share on other sites More sharing options...
jeffman Posted May 15, 2011 Share Posted May 15, 2011 Escape them with the \ character:'document.getElementById(\"div\").style.display=\"none\";' Link to comment Share on other sites More sharing options...
HungryMind Posted May 15, 2011 Author Share Posted May 15, 2011 Ooh Thank you So Much. You Are Really Awesome. :)Thanks a lot Escape them with the \ character:'document.getElementById(\"div\").style.display=\"none\";' Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.