Discussion: Change class problem
Afficher un message
Vieux 09/04/2008, 13h01   #3
Joost Diepenmaat
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Change class problem

Test <test@.nil.invalid.com> writes:

> <html> <head>
> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
> <style type="text/css">
> <!--
> td { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; color:
> #000000;}
> td.onetype {
> background-color: #F1F1F1;
> border: 1px #000000 solid;
> }
>
> td.another {
> background-color: #F100F1;
> border: 1px #000000 solid;
> }
> -->
> </style>
> <script>
> function zub()
> {
> document.getElementById("one").parentNode.classNam e = "onetype";


^^^ this changes the class of the <tr>, not the class of the <td> that
you clicked on, and that's selected by the css above.

> document.getElementById("one").innerHTML="Works?";


that will just delete the <td> alltogether. Try taking a look in the
HTML view of firebug.

--
Joost Diepenmaat | blog: http://joost.zeekat.nl/ | work: http://zeekat.nl/
  Réponse avec citation
 
Page generated in 0,05840 seconds with 9 queries