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

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: Using JavaScript methods By JavaScript itself (automatically) Converting Numbers to Strings Using JavaScript method The JavaScript function String() can convert numbers into strings. String() can take … 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

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

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

JavaScript variables

Variable is a user given name to a memory location where user can store values and can access it using variable name. user can give any valid variable name to store data. Variables can store different types of data like integer,character,string, boolean,real values etc. Syntax

for all kind of variable we use var keyword … Read more

Getting Current URL of web page

Address bar shows current url if you want to access in javascript program then we use window.location.href Syntax

Example:

Change background color on button click in javascript

Change background color on button click in javascript is a good example of DOM manipulation. You can change the background color of any element like div, paragraph or can change the color of the HTML body. To change the background color we use style property. Let us see one by one Changing the background color … Read more