Answer the question
In order to leave comments, you need to log in
How can I write a string in func in a different way, that is, without this?
<ol>
<li>11</li>
<li>333</li>
</ol>
<script>
var elems=document.getElementsByTagName('li');
for(var i=0;i<elems.length;i++){
elems[i].addEventListener('click',func);
}
function func(){
this.parentElement.removeChild(this);
}
</script><code></code>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question