Epic React course: Welcome exercise
In the first exercise, I learned that there is more than one way to set the id for a dom element. One way is to use the setAttribute method and the other way is to get the returned dom element and assign the id value to it.
1. const divEle = document.createElement(’div’);
divEle.setAttribute(’id’,’root’)
2. divEle.id = ‘root‘;
The other learning is that, I was trying to assign a div element to the body tag by using the following but it didn’t work, have to figure out why.
document.getElementByTag(’body’);













