JavaScript while loop

The while loop loops through a block of code as long as a specified condition is true. The condition is evaluated before executing the statement. In this tutorial, you will learn how … Read more

JavaScript for loop

The JavaScript for loop iterates the elements for the fixed number of times. JavaScript for loop should be used if number of iteration is known. A for loop repeats until a specified condition evaluates … Read more

JavaScript – innerText Property

JavaScript – innerText Property is used to write the dynamic text on the html document. It sets or returns the text content of the specified node, and all its descendants. … Read more

JavaScript – innerHTML Property

The innerHTML property sets or returns the HTML content (inner HTML) of an element. It can be used to write the dynamic html on the html document. Syntax Return the … Read more

Javascript – document.getElementById() method

The document.getElementById() method returns the element of specified id. The getElementById() is a DOM (Document Object Model) method. This method returns null if no elements with the specified ID exists. The ID should be unique within a … Read more

JavaScript Math random() method

The JavaScript Math.random() method returns the random number between 0 (inclusive) and 1 (exclusive). In this article you will learn about “How to generate random number in JavaScript?”. Syntax Parameters Math.random() … Read more

JavaScript Switch Statement

A switch statement is a control-flow statement that tests the value of an expression against multiple cases. In this tutorial, you will learn about the JavaScript switch statement with the help of examples. A switch statement … Read more