Archivi tag: cross browsing

Cambiare il tipo ad un tag input – Change type of input field (Cross browsing problem)


Problema: Cambiare il tipo (type) di un tag input (es: da sumbit a button) tramite javascript al momento del caricamento della pagina o al verificarsi di qualsiasi altro evento.

La funzione JQuery .attr() non può cambiare l’attributo type dei vari tag per via di un problema che si verifica con le seguenti versioni di Internet Explorer (Note: jQuery prohibits changing the type attribute on an <input type=”text” /> or <button> element and will throw an error in all browsers. This is because the type attribute cannot be changed in Internet Explorer):

IE 6, IE 7, IE 8

Continua a leggere