Usando jquery non dovresti avere di questi problemi.