Hi all,


I would like to ask for help on how to change the
background of a <td> from javascript.  I have the
following code.



<script language="javascript">
  function shade(idx) {
    str = "sp_" + idx;
    //How to shade the <td> tag with the id of str?
  }
</script>
<table>
  <tr>
    <td id="sp_1"></td>
    <td id="sp_2"></td>
    <td id="sp_3"></td>
    <td id="sp_4"></td>
    <td id="sp_5"></td>
    <td id="sp_6"></td>
  </tr>
  <tr>
    <td colspan="6"><input type="button"
onClick="shade(6)"</td> 
  </tr>
</table>



How do I change the background color of sp_6 since I
know the id name only but now  the object?  How do I
get the object name "sp_6"?



Any help would be very much appreciated.  Thanks



Chris


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/AspClassicAnyQuestionIsOk/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to