SitePoint Sponsor |
|
User Tag List
Results 1 to 3 of 3
Thread: inline css with javascript
-
Feb 1, 2008, 11:18 #1
inline css with javascript
hey
i set the rollover background color for table rows with this code
Code JavaScript:this.style.cursor='hand';this.style.backgroundColor='Khaki'
but is there a way that instead of specifying the color name, i can get that information from a css stylesheet?
Thanks
Ras
-
Feb 1, 2008, 11:40 #2
- Join Date
- Mar 2002
- Location
- northern MI
- Posts
- 1,392
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Yes swap the CSS class of the element
-
Feb 1, 2008, 14:20 #3
Just for future reference of anyone who needs to know.
Code JavaScript:this.className='CSSClassNameHere';
this seems to work.
Bookmarks