An Interest In:
Web News this Week
- April 19, 2024
- April 18, 2024
- April 17, 2024
- April 16, 2024
- April 15, 2024
- April 14, 2024
- April 13, 2024
August 17, 2021 07:04 pm GMT
Difference between
Original Link: https://dev.to/gauravshekhawat/day-4-100-days-of-code-3egl
Day 4: 100 days of code
DIfference between innerHTML and innerText in js
see this medium article for details.
This is short summary of the above article.
Difference between getElementById
and getElementsByClassName
The difference that I found through trial and error:-
The getElementById
will select only one element(as only one element will have that unique id), while in the arguments of getElementsByClassName
we can provide multiple classes, and it will select all the elements matching those classes. Hence getElementsByClassName
is like an array. Example:-
<div class="parentDiv"></div>
To access the above, you have to write
var divToBeAppended = document.getElementsByClassName("parentDiv");divToBeAppended[0].appendChild(newButton);
Important things to remember:-
In case of a image as direct child of an div with rounded corners, the image will overflow through the container. To stop that, you can use:-
.container{overflow:hidden;}
Things i couldn't make a summary of:-
- Change button colors project
- Kotlin basics:- functions, variables, etc.
Things couldn't complete ( try again)
- CP problem:- Time is Mooney
- CP DP handbook last section
Original Link: https://dev.to/gauravshekhawat/day-4-100-days-of-code-3egl
Share this article:
Tweet
View Full Article
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To