[Javascript] styling text

Scott Petersen petersen at ma.medias.ne.jp
Fri Nov 30 19:20:09 CST 2007


I have a problem I can't seem to solve.
I want to take this markup:

	<div id="theList">
		<ol>
			<li>
				<span>dirty</span>
				<span>汚い</span>
				<span>I have to clean my room. It is dirty.</span>
			</li>
		</ol>
	</div>

and color the word "dirty" in the sentence blue, or set it off in  
some other way. I thought to create a span element and style it with  
CSS. However, I am not able to replace the plain text with the span  
element. I could mark the word up to begin with, but for work flow I  
thought I might try to let javascript do the work.

Any thoughts?

Scott Petersen

By the way, the Japanese is merely a gloss of the English.


More information about the Javascript mailing list