This question already has an answer here:
- addEventListener not working in IE8 9 answers
I am trying to make a javascript button so that when it's pressed it deletes the content of the page. I figured it out how to make it in Chrome, but in IE 8 it does not work.
function button(){
var btn = document.createElement('button');
btn.innerHTML = 'Back';
if(btn.addEventListener)
btn.addEventListener('click',function(){
document.body.style.display="none";});
document.body.appendChild(btn);}
Aucun commentaire:
Enregistrer un commentaire