Tuesday, September 7, 2021

How to access DOM object?

 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

Element of a good table (Ref: Database design mere mortals by Michael J. Hernandez)

  Elements of the Ideal Table: It represents a single subject, which can be an object or event that reduces the risk of potential data integ...