[parenscript-devel] this.bgcolor

Alex Mizrahi alex.mizrahi at gmail.com
Sun Jun 20 17:57:54 UTC 2010


 HB> How to set bgcolor within td tag (cl-who):
 HB> (:td (ps (setf bgcolor "blue")))
 HB> or something like this to get
 HB> this.bgcolor="blue"      ?

You need to decide how it is going to look in HTML/JavaScript/CSS first.
I don't think this is going to work:

<td><script>this.bgcolor="blue";</script></td>

It just doesn't make any sense.
Best way to implement this is via CSS:

<style>
.blue { background-color: blue;}
</style>
...
<td class="blue"></td>

If you absolutely want to use JavaScript, you need to assign element ID:

<td id="myTD25"></td>

And then refer to it in JS:

document.getElementById("myTD25").style.backgroundColor = "blue";




More information about the parenscript-devel mailing list