By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,317 Members | 1,265 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,317 IT Pros & Developers. It's quick & easy.

document type does not allow element "img" here

P: 1
I try to validate my xhtml and i have a little problem with this:

<script type="text/javascript">

var faq=new switchicon("icongroup1", "div") //Limit scanning of switch contents to just "div" elements
faq.setHeader('<img src="minus.jpg" alt="Content Management System" />', '<img src="plus.jpg" alt="Content Management System" />') //set icon HTML
faq.collapsePrevious(true) //Allow only 1 content open at any time
faq.setPersist(false) //No persistence enabled
faq.defaultExpanded(0) //Set 1st content to be expanded by default
faq.init()

</script>

while i validate i am getting the following errors
document type does not allow element "img" here

i am also used
<![CDATA[ ---- ]]>
If i use this my script not working kindly help me
Dec 3 '11 #1
Share this Question
Share on Google+
2 Replies


drhowarddrfine
Expert 5K+
P: 7,435
You are asking for HTML help but show javascript. We need the resulting HTML to help you and what little you show in the js is not helpful.
Dec 3 '11 #2

omerbutt
100+
P: 638
hi Jeevan,
try using the cdata inside the javascript tag like this , and i assume that you have included this script tag inside the <head> tag ,
Expand|Select|Wrap|Line Numbers
  1.  <script type="text/JavaScript">
  2.         //[CDATA[
  3. var faq=new switchicon("icongroup1", "div") //Limit scanning of switch contents to just "div" elements
  4. faq.setHeader('<img src="minus.jpg" alt="Content Management System" />', '<img src="plus.jpg" alt="Content Management System" />') //set icon HTML
  5. faq.collapsePrevious(true) //Allow only 1 content open at any time
  6. faq.setPersist(false) //No persistence enabled
  7. faq.defaultExpanded(0) //Set 1st content to be expanded by default
  8. faq.init()
  9.  
  10. //]]
  11. </script>
  12.  
regards,
Omer Aslam
Dec 4 '11 #3

Post your reply

Sign in to post your reply or Sign up for a free account.