Lokesh Yadav has Published 54 Articles

First and last child node of a specific node in JavaScript?

Lokesh Yadav

Lokesh Yadav

Updated on 09-Dec-2022 10:04:58

488 Views

In this article we are going to learn about the first and last child node of a specific node in JavaScript along with suitable examples. To get the first and last child node of a specific node, there are existing properties called firstChild, lastChild, firstElementChild and lastElementChild. The difference between ... Read More

Remove the child node of a specific element in JavaScript?

Lokesh Yadav

Lokesh Yadav

Updated on 09-Dec-2022 09:57:51

5K+ Views

In this article we are going to discuss how to remove the child node of a specific element in JavaScript with appropriate examples. To remove the child node of a specific element, there is an existing method in JavaScript called removeChild(). The removeChild() method is different from the remove() method. ... Read More

Sibling of a list element in JavaScript?

Lokesh Yadav

Lokesh Yadav

Updated on 09-Dec-2022 09:54:34

5K+ Views

In this article, we are going to learn about the sibling of a list element in JavaScript with suitable examples. To find the sibling of a list element in JavaScript, there is an existing property called nextSibling. The nextSibling property returns the next node on the same tree level. The ... Read More

Insert a node as a child before an existing child in JavaScript?

Lokesh Yadav

Lokesh Yadav

Updated on 09-Dec-2022 09:51:20

557 Views

In this article, we are going to learn how to insert a node as a chils before an existing chilin JavaScript with appropriate examples. The Javascript has provided insertBefore() method to insert a node as a child before another child. If there are 2 lists we can shuffle the elements ... Read More

Insert a specified element in a specified position in JavaScript?

Lokesh Yadav

Lokesh Yadav

Updated on 09-Dec-2022 09:48:55

1K+ Views

The given task to perform in this article is to insert a specified element in a specified position in JavaScript. The Javascript has provided "insertAdjacentElement()" to insert an already existing element in a specified position. There are four specified legal positions. The first position is ‘afterbegin’ (After the beginning of ... Read More

Insert a specified HTML text into a specified position in the JavaScript document?

Lokesh Yadav

Lokesh Yadav

Updated on 09-Dec-2022 05:50:36

619 Views

In this article, we are going to learn how to insert a specified HTML text into a specified position in the JavaScript document with suitable examples. There is an existing method in the JavaScript to insert a specified HTML text into a specified position in the JavaScript document i.e. insertAdjacentHTML() ... Read More

An element inside another element in JavaScript?

Lokesh Yadav

Lokesh Yadav

Updated on 09-Dec-2022 05:49:32

6K+ Views

In this article, we are going to discuss about an element inside another element in JavaScript with suitable examples. In JavaScript to access an element within another element i.e.., the inner element, we use ‘.’ property. We can also check whether an element is present within another element or not ... Read More

Replace a child node with a new node in JavaScript?

Lokesh Yadav

Lokesh Yadav

Updated on 09-Dec-2022 05:48:10

2K+ Views

In this article we are going to learn how to replace a chils node with a new node in JavaScript with suitable examples. To replace a child node with a new node, there is an inbuilt method to replace the new node with the old node within a given parent ... Read More

Number of elements a particular tag contains in JavaScript?

Lokesh Yadav

Lokesh Yadav

Updated on 09-Dec-2022 05:46:04

802 Views

In this article we are going to learn about the number of elements a particular tag contains in JavaScript with suitable examples. There are two possible ways to find the number of elements a particular tag contains in JavaScript. One of the possible way is to use the existing property ... Read More

Built-in javascript constructors?

Lokesh Yadav

Lokesh Yadav

Updated on 09-Dec-2022 05:43:25

650 Views

In this article, we are going to discuss about the Built-in JavaScript constructors with appropriate examples in JavaScript. Javascript has provided some built-in constructors for native objects. These built-in functions include Object(), String(), Boolean(), RegExp(), Number(), Array(), Function(), Date(). Note We cannot include Math object in those built-in constructors because ... Read More

Advertisements