style.type should have been style.setAttribute