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 t…


This content originally appeared on DEV Community and was authored by Gaurav-Shekhawat

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:-

  • centering using margin auto

  • 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


This content originally appeared on DEV Community and was authored by Gaurav-Shekhawat


Print Share Comment Cite Upload Translate Updates
APA

Gaurav-Shekhawat | Sciencx (2021-08-17T19:04:40+00:00) Day 4: 100 days of code. Retrieved from https://www.scien.cx/2021/08/17/day-4-100-days-of-code/

MLA
" » Day 4: 100 days of code." Gaurav-Shekhawat | Sciencx - Tuesday August 17, 2021, https://www.scien.cx/2021/08/17/day-4-100-days-of-code/
HARVARD
Gaurav-Shekhawat | Sciencx Tuesday August 17, 2021 » Day 4: 100 days of code., viewed ,<https://www.scien.cx/2021/08/17/day-4-100-days-of-code/>
VANCOUVER
Gaurav-Shekhawat | Sciencx - » Day 4: 100 days of code. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/08/17/day-4-100-days-of-code/
CHICAGO
" » Day 4: 100 days of code." Gaurav-Shekhawat | Sciencx - Accessed . https://www.scien.cx/2021/08/17/day-4-100-days-of-code/
IEEE
" » Day 4: 100 days of code." Gaurav-Shekhawat | Sciencx [Online]. Available: https://www.scien.cx/2021/08/17/day-4-100-days-of-code/. [Accessed: ]
rf:citation
» Day 4: 100 days of code | Gaurav-Shekhawat | Sciencx | https://www.scien.cx/2021/08/17/day-4-100-days-of-code/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.