<script> var navbar = document.querySelector('.fixed-top'; window.onscroll = function() { // pageYOffset or scrollY if (window.pageYOffset > 0) { navbar.classList.add('scrolled') } else { ... READ MORE >>
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 1 <!DOCTYPE html> <html> <head> <meta charset="utf-8"> </head> <body> <ul id="menu"> <li>Home</li> <li>Services</li> </ul> ... READ MORE >>
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