Document Object Model is the data
representation of a website component.
How do you select an element from the DOM?
I can select an element different ways likes
select via Id, Class, tagname etc.
What is event delegation in the context of the DOM, and
why is it useful?
Its a even handling process. By this we can
handle events at a higher level in the DOM tree instead of the event actually occur. By using
it, our code complexity will be reduce and performance of website will be high.
How do you manipulate an element's attributes and styles
using the DOM?
We can manipulate elements attributes by
getAttribute()
setAttribute
removeAttribue()
we can give styles thru Javascript. After selecting the element. Just add style and then
attribute and property.