Tengo a precisare che il metodo setAttribute() non è compatibile con IE6 (e forse anche con IE7)