We can access dom object by querySelector with id in css.
ex:document.querySelector('#score').textContent=100;
We can access dom object by querySelector with class in css.
ex:document.querySelector('.score').textContent=100;
here ,.score is the class name in css.
if we want to set any html in any html then we use innerHtml.
ex:document.querySelector('.score').textContent='<em>'+100+'</em>';
No comments:
Post a Comment