JavaScript Introduction

JavaScript is a client-side scripting language. Javascript code is downloaded from the server and executed on client’s browser. We can include javascript statements in html file or we can create a javascript file and can import it on html files. In html file we can use script tag to write javascript statements. Syntax

we … Read more

Add active class onclick javascript and jQuery

Add active class to a div on javascript onclick event Here we are applying a style to a simple div. Steps to add a css class on click event

Add active class onclick javascript to HTML ul List to make menu Here We have ul list elements to create horizontal menu on click on … Read more

Type Conversion in JavaScript

Type Conversion in JavaScript means converting one data type to another. JavaScript data type or variables can be converted into a different variable and/or different data type by the following ways: Converting Numbers to Strings Using JavaScript method The JavaScript function String() can convert numbers into strings. String() can take any numbers, literals, variables, or expressions. Consider … Read more

Operator Precedence and associativity in JavaScript

Operator Precedence Operator precedence determines the order in which operators are evaluated when more than one operator is used in an expression. The higher an operator’s precedence, the earlier it is evaluated in comparison with the operators with lower precedence. Consider the following example:

The above expression is evaluated in the order of the … Read more

Get ASCII value of char javascript charCodeAt() & codePointAt()

get the ASCII value of char javascript ASCII is a Character Encoding Scheme. The full form of ASCII is American Standard Code for Information Interchange. ASCII Encode any character in 7 bits. it was developed for telegraph code. ASCII is used to represent 128 English characters in Numbers. ASCII value for A is 65, B … Read more

How to get multiple checkbox value in javascript and JQuery

On many websites, you find multiple check box forms to select your interest, or to select multiple options. That can be created by using the HTML check box.

Here to make an input as a text box we need type=”checkbox”. name is a name given to a text box value property that specifies what … Read more

isPrime() Javascript : Prime number program in Javascript

isPrime() Javascript represents a prime number checker function in Javascript. Prime number is a number which is divisible by one and number itself. like numbers 5,7,11,13,17, etc are prime numbers. Prime number program in javascript using for loop Below program uses for loop to check a number is prime or not. Create a function isPrime() … Read more

JavaScript Multiplication Table Program with HTML CSS

JavaScript Multiplication Table is a multiplication table for any number. Using JavaScript we program and generate a multiplication table of any number. Java multiplication table generation using for loop is developed as below Create a text box to get a number from the user. Create a button to submit value on the button click to … Read more

Window.resizeTo() in javascript

The window object represents the web browser’s window. There are various methods available in the window. one of them is resizeTo(). resizeTo() the method is used to resize the window.

This Keyword in JavaScript

This keyword refers to an object, that object which is executing the current bit of JavaScript code. JavaScript function while executing has a reference to its current execution of any function, called this. JavaScript function while executing has a reference to its current execution of any function, called this. with this keyword, It does not matter how and where … Read more