How-to articles, tricks, and solutions about JAVASCRIPT

How to Convert the Image into a Base64 String Using JavaScript

Read this tutorial and learn several methods of converting an image to a Base64 string using JavaScript. Choose the right approach for you and try examples.

How to Detect Escape Key Press Using jQuery

Read this tutorial and learn the two methods of detecting an escape key press using jQuery. Read about keyup and keydown event handler and see examples.

How to Define Global Variable in a JavaScript Function

Read the tutorial and learn how to define a global variable in a JavaScript function. Also, read about the differences about the global and local variables.

How to Create a Popup Form Using JavaScript

Read this JavaScript tutorial and learn how to create popup login, contact, multiple popup logins in one page and other forms on your website with examples.

How to Convert a Number to a String in JavaScript

Read the tutorial and find several easy and fast approaches to converting a number to a string in JavaScript. Choose the best method for your workflow.

How to Split Array into Chunks

Read the tutorial and find several easy and fast approaches to splitting a JavaScript array into smaller chunks. Choose one of the methods and try examples.

How to Split a String Breaking at a Particular Character in JavaScript

Read this tutorial and find two easy and fast methods of splitting the string breaking at a particular character in JavaScript. Also, find and try examples.

How to Write a Function that Accepts Any Number of Arguments in JavaScript

Read this JavaScript tutorial and find two easy methods of writing a function that will accept an indefinite number of arguments. See and try examples.

How to Check a Webpage is Loaded Inside an iframe or into the Browser Window

Read this JavaScript tutorial and find a working code for checking whether the webpage is loaded inside an iFrame or directly into the browser window.

How to Remove Objects from a JavaScript Associative Array

JavaScript objects can be taught of associative arrays mapping keys to values. Read and find the method used to remove objects from an associative array.

How to Create a New DOM Element from HTML String

Read this JavaScript tutorial and find the method that is used for creating a new DOM element from an HTML string. Get the explanation and see examples.

How to Strip HTML from a String in JavaScript

In this tutorial, you will find several approaches to strippingan HTML from a sting in JavaScript easily. Get the codes and explanations right away.

How to Check for the Existence of Nested JavaScript Object Key

In this tutorial, you will find several methods that are used to test the existence of the nested JavaScript object keys. Also, find how to avoid TypeError.

How to Test If a Checkbox is Checked with jQuery

In this tutorial, you will find several jQuery methods that are used for testing whether the checkbox is checked based on the different versions you use.

How to Use jQuery Selectors on Custom Data Attributes

In this tutorial, you will find useful information about the usage of jQuery selectors on custom data attributes. See examples and solve your problem.

How to Print a Circular Structure in a JSON-like Format

In this JavaScript tutorial, you will find useful information about the method that is used to format an object to JSON what contains circular structure.

How to Format Number with Two Decimals

In this JavaScript tutorial, you will find information about the formatting number to display with two decimals. Also, read about solving rounding issues.

How to Find the Min/Max Elements in an Array in JavaScript

Read this JavaScript tutorial and learn about the methods used to find the minimum and maximum number of elements in an array. Find the fastest solution.

How to HTML-encode a String

Read this JavaScript tutorial and learn about some useful and fast methods that help you to HTML-encode the string without causing the XSS vulnerability.

How to Clear Local Storage JavaScript

Read this JavaScript tutorial and learn useful information about localStorage and methods that clear the local storage of records for a specific domain.

How to Insert an Element After Another Element in JavaScript

Read this JavaScript tutorial and learn useful information about modern approaches of inserting an element after another element using two easy methods.

How to Get the Browser Viewport Dimensions

Read this JavaScript tutorial and learn information about two sets of properties that are used to obtain the height and width of the viewport dimension.

How to Get a Class Name of an Object

Read this tutorial and learn information about several methods that are used for getting the class name of the object in JavaScript. Also, try examples.

How to Find the Sum of an Array of Numbers

Read this JavaScript tutorial and learn several methods used to find or calculate the sum of an array of numbers. Also, find which is the fastest one.

JavaScript: bind() vs apply() and call()

Read this JavaScript tutorial and learn about the main differences between the function prototype methods: bind(), call() and apply() and their usages.