getElementsByTagName

Introduction to JavaScript getElementsByTagName() method The getElementsByTagName() is a method of the document object or a specific DOM element. The getElementsByTagName() method accepts a tag name and returns a live HTMLCollection of elements with the matching tag name in the…

Continue ReadinggetElementsByTagName

getElementsByName

Introduction to JavaScript getElementsByName() method Every element on an HTML document may have a name attribute: <input type="radio" name="language" value="JavaScript"> Unlike the id attribute, multiple HTML elements can share the same value of the name attribute like this:…

Continue ReadinggetElementsByName

getElementById

Introduction to JavaScript getElementById() method The document.getElementById() method returns an Element object that represents an HTML element with an id that matches a specified string. If the document has no element with the specified…

Continue ReadinggetElementById

async/await

Introduction to JavaScript async / await keywords In the past, to deal with asynchronous operations, you often used the callback functions. However, when you nest many callback functions, the code will…

Continue Readingasync/await

Promises

Imagine that you’re a top singer, and fans ask day and night for your upcoming song. To get some relief, you promise to send it to them when it’s published.…

Continue ReadingPromises

Callbacks

What are callbacks In JavaScript, functions are first-class citizens. Therefore, you can pass a function to another function as an argument. By definition, a callback is a function that you pass into another function as…

Continue ReadingCallbacks

Rest Parameters

Introduction to JavaScript rest parameters ES6 provides a new kind of parameter so-called rest parameter that has a prefix of three dots (...). A rest parameter allows you to represent an indefinite number…

Continue ReadingRest Parameters