W3C home > Mailing lists > Public > www-style@w3.org > September 2002

CSS class and changing with javascript

From: jonathan chetwynd <j.chetwynd@btinternet.com>
Date: Sun, 1 Sep 2002 11:57:32 +0100
Message-ID: <00a601c251a6$6119b190$0201a8c0@RJCHETWYND>
To: <www-style@w3.org>
I'd like to change CSS class values using javascript, what works?

html
<a href=http://www.sugababes.com><img
src="http://www.peepo.com/copyright/bands/sugababes.jpg" class="myLong"
/></a>

css
.myLong  {width:30%;}

js
myLong.style.width=10%

except this js doesn't work.

what would?

thanks

Jonathan
Received on Sunday, 1 September 2002 06:58:44 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:16 GMT