There are many ways to store JSON data for your application. You can store it in an array or in an external file. There are many ways to read JSON data from external files. I have previously shared ...
The URL or the web address will always have a file name, with few parameters occasionally. Sometimes, we might need to know the file name in the URL. There’s a simple technique to extract the file ...
There are many ways you can change the class name of an element using JavaScript. The classList property in JavaScript is now commonly used. However, classList property and its methods are available ...
HTML ul and li elements are often used to show a list of items with bullet points on a web page. You can add these elements at design time and dynamically at run time. I’ll show you how you can create ...
You can use window.location.href property to redirect or open a page from your JavaScript code. If you want to redirect a page automatically after a delay then you can use the setTimeout() method ...
Operators in JavaScript are used to perform various mathematical and logical comparisons on data values or operands, to produce a result. ...
You can use the navigator .onLine property in JavaScript to find out whether your browser in online or offline. It actually gives you status of your internet connection. ...
You can use the clientHeight property to measure the inner height of an element, including padding. However, it will exclude the borders, margins and scrollbar height of the element. The offsetHeight ...
An array in JavaScript can hold different types of value in a single variable. The value can be a string or a number. Sometimes you might have to separate the numbers and strings from the array. ...
You can use the “onfocus” attribute in JavaScript to clear a textbox or an input box when somebody sets focus on the field. If you are using jQuery, then use the “.focus()” method to clear the field. ...