Ver Mensaje Individual
  #8 (permalink)  
Antiguo 13/11/2012, 18:32
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: Compatibilidad de removeAttribute() en IE8. Que opinan?

removeAttribute() solo trabaja en IE(7/8/9), y solo sirve para remover atributos inherentes al estilo del objeto, por ejemplo
Código HTML:
Ver original
  1. <!DOCTYPE html>
  2. <html lang="es-ar">
  3. <meta charset="utf-8" />
  4. <title>Html5</title>
  5. <script type="text/javascript">
  6. function RemoverBg_1(boton) {
  7. boton.style.removeAttribute ("backgroundColor");
  8. }
  9. function RemoverBg_2(boton) {
  10. boton.style.removeAttribute ("backgroundcolor",0);
  11. }
  12. function RemoverBg_3(boton) {
  13. boton.style.removeAttribute ("backgroundcolor");
  14. }
  15. </head>
  16. <p>
  17. <button onclick="RemoverBg_1(this);" style="background-color:lime;">Quitar color de fondo</button>
  18. </p>
  19. <p>
  20. <button onclick="RemoverBg_2(this);" style="background-color:red;">Quitar color de fondo</button>
  21. </p>
  22. <p>
  23. <button onclick="RemoverBg_3(this);" style="background-color:green;">Quitar color de fondo 3 (no funcionará)</button>
  24. </p>
  25. </body>
  26. </html>
El 2º parámetro al que hace referencia @furoya, con valor 0 hace "noCase" la referencia a la propiedad.
el equivalente para navegadores NO IE es removeProperty()

Para quitar el readonly
elemento.readOnly = false;


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