Jump to content

set partial text color via javascript


dodgeitorelse3

Recommended Posts

I have been working on this code for quite some time

var ul = top.document.getElementById("sub-menu");   
    var li = top.document.createElement("li");
    var a = document.createElement('a');
	var stradd = " (tours.ini not found)";
	var linkText = document.createTextNode("<?php echo $loguname;?>"+stradd);
	a.appendChild(linkText);
	a.href = "tours_U/<?php echo $loguname;?>/tours.ini";
	li.appendChild(a);
	li.setAttribute("name", "tours_download[]");
	li.setAttribute("id", "li<?php echo $loguname;?>");
	li.style.fontSize="12px";
	ul.appendChild(li);

what I am having trouble doing is setting the color of stradd variable. I cannot figure out how to access just that part to make the font color white (parenthesis included).

 

Where can I find documentation to help me sort this out?

Link to comment
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.