Skip to content

Tag Archives: JavaScript-Misc

Way of implementing line breaks differ from one platform to another. The following approach takes input text from HTML Textarea and adds line breaks using… Read More
In some cases, it is necessary to determine whether the browser is online or offline before performing a required task. Many developers use AJAX to… Read More
To display meta tag information in HTML with JavaScript, we will use a method called getElementByTagName() function. Method 1: Using getElementsByTagName() method. Syntax: document.getElementsByTagName("meta"); With… Read More
Given a JavaScript number and the task is to set, clear and toggle a single bit of any number. Here are few approaches discussed with… Read More
Both freeze and seal are used to create non extensible objects in JavaScript, but there are plenty of differences between them. Object.seal() allows changes to… Read More
An array is a special variable in all the languages that is used to store different elements. JavaScript array contains some built-in properties that every… Read More
In JavaScript, holding down a key will fire the key continuously until it is released. This behavior may be used in applications such as games… Read More
There are two methods to smoothly scroll a web page after clicking the anchor link which are discussed below: Method 1: Using scrollIntoView() with the… Read More
Given a long number and the task is to convert it to the abbreviated string(eg.. 1234 to 1.2k). Here 2 approaches are discussed with the… Read More
Given the HTML document. The task is to detect when the backspace and delete keys are pressed on keydown events. Here 2 approaches are discussed,… Read More
Given an HTML document and the job is to replace the entire HTML element by a new one with the help of JavaScript. A few… Read More
NaN as in most programming languages means Not A Number. It belongs to the numeric data types(int, long, short, etc). It represents a numeric value… Read More
The task is to detect the android version of the user with the help of JavaScript. Two approaches are discussed here, first example uses the… Read More
The tree view elements are kind of dropdown menu however well organized. This kind of view gives your web site an organized look, to create… Read More
The task is to check if the passed URL is absolute or relative. Below are the few approaches: Approach 1: Use Regular Expression which checks… Read More

Start Your Coding Journey Now!