[thelist] JavaScript: Change Class

Brett Stinson brettastinson at comcast.net
Fri Jul 11 17:22:51 CDT 2003


Casey:
  This sounds like what you were asking for....
Hope it helps.....


________________________code example_________________________________
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<LINK rel="stylesheet" type="text/css" href="Styles.css">
<script language="javascript">
function changeSty(classpassed){
	document.getElementById('featured').className=classpassed;
}
</script>
</HEAD>
<BODY>
<form>
<table>
<tr>
<td class="home_text_black">Completed:</td>
<td><input type="radio" name="active" value="1"
onClick="form.featured.disabled=true;changeSty('home_text_grey');"></td>
<td class="home_text_black">Current:</td>
<td id="featured" class="home_text_black">
     <input type="radio" name="active" value="2" checked
onClick="form.featured.disabled=false;changeSty('home)_text_black');">
     <input type="checkbox" name="featured" value=""> - Fubar Text
</td>
</tr>
</td>
</form>

</BODY>
</HTML>
______________________________end code
example_________________________________

I have not tested it in netscape, but it works in IE.  :-)

Brett Stinson
bstinson at programmer.net <mailto:bstinson at programmer.net>




-----Original Message-----
From: thelist-bounces at lists.evolt.org
[mailto:thelist-bounces at lists.evolt.org]On Behalf Of Casey Crookston
Sent: Friday, July 11, 2003 4:41 PM
To: thelist at lists.evolt.org
Subject: [thelist] JavaScript: Change Class


JavaScript question for the list:

I have a form with a simple little javascript toggle to make a selection
unavailable depeneding on the selection.  What I'd like to do is also switch
the class in the last td from BLACK to GREY. (see code below)

Any idears?

Thanks, Casey

<td class='home_text_black'>Completed:</td>
<td><input type='radio' name='active'  value='1'
onClick='form.featured.disabled=true;'></td>

<td class='home_text_black'>Current:</td>
<td class='home_text_BLACK>
     <input type='radio' name='active' value='2' checked
onClick='form.featured.disabled=false;'>
     <input type='checkbox' name='featured' value=''> - Fubar Text
</td>





--
* * Please support the community that supports you.  * *
http://evolt.org/help_support_evolt/

Evolt.org conference in London, July 25-27 2003.  Register today at
http://evolt.org.uk

For unsubscribe and other options, including the Tip Harvester
and archives of thelist go to: http://lists.evolt.org
Workers of the Web, evolt !





More information about the thelist mailing list