Jump to content

AJAX color problem


djbuddhi

Recommended Posts

just innerHTML some html tags like the span with an inline style:

document.getElementById("div_id_naMr").innerHTML='<span style="color:red;">hello in red!</span>';  

always make sure you innerHTML complete and properly nested html with all closing tags or you'll have problems with some browsers.  You can innerHTML  any html including image tags, links, divs, and even whole html tables.  You cannot innerHTML whole web pages with the HTML and BODY tags and you cannot innerHTML javascript, it will not execute.  But other than that you can innerHTML any HTML:

document.getElementById("div_id_naMr").innerHTML='<a href="?"><img src="myimage.jpg"></a><br><span style="color:red;">hello in red!</span>';  

 

 

Link to comment
https://forums.phpfreaks.com/topic/92606-ajax-color-problem/#findComment-474906
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.