Ver Mensaje Individual
  #5 (permalink)  
Antiguo 08/06/2012, 12:08
Avatar de emprear
emprear
Colaborador
 
Fecha de Ingreso: junio-2007
Ubicación: me mudé
Mensajes: 8.388
Antigüedad: 16 años, 10 meses
Puntos: 1567
Respuesta: Agregar clase a tbody

@elgoncho99
Te recuerdo que javascript es "case sensitive", y el nombre de la propiedad es
className
y no
classname
Por supuesto podemos usar classname si lo interpretamos como una variable

ejemplo
Código HTML:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <title>titulo</title>
  5. <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  6. <style type="text/css">
  7. /*<![CDATA[*/
  8. .rojo{
  9. color: red;
  10. }
  11. /*]]>*/
  12. <script type="text/javascript">
  13. //<![CDATA[
  14. function crear_Capa(){
  15. var capa = document.createElement( 'div' );
  16. capa.innerHTML = "texto";
  17. capa.className = "rojo";
  18. capa.setAttribute('title', 'div con texto rojo');
  19. document.body.appendChild(capa);
  20. }
  21. window.onload = crear_Capa;
  22. //]]>
  23. </head>
  24. </body>
  25. </html>


SAludos
__________________
La voz de las antenas va, sustituyendo a Dios.
Cuando finalice la mutación, nueva edad media habrá
S.R.