Month: May 2021

Navbar Fixed JS Code Logic

<script> var navbar = document.querySelector('.fixed-top'; window.onscroll = function() { // pageYOffset or scrollY if (window.pageYOffset > 0) { navbar.classList.add('scrolled') } else { ...
READ MORE   >>

innerHTML vs createElement in DOM

Following Example explain the differences between innerHTML and createElement when it comes to creating new elements. Example of create Element <body>    <div class="container"></div> <script> let div =...
READ MORE   >>

Task using Manipulating Elements

Task 1 <!DOCTYPE html> <html> <head> <meta charset="utf-8"> </head> <body> <ul id="menu"> <li>Home</li> <li>Services</li> </ul> ...
READ MORE   >>

Manipulating Elements in DOM

1. createElement() – create a new element and returns a new Node with the Element type. Syntax let element = document.createElement(htmlTag); 2. appendChild()  – append a node to a list of child nodes of a specified parent...
READ MORE   >>

Recent Comments

    • Copyright © 2020 (Er. Shairy Kalra). All Rights Reserved