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

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

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

Try Catch and Finally in JavaScript

The try statement tests a block of code for errors.The catch statement handles the error. The throw statement throws or creates custom errors.With finally statement the code will be executed, after try and catch, function will return a result. Errors will happen, when executing a code, different errors can occur. Error handling try and catch … 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 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 user. Create a button to submit value on button click call the multiplicationTable() function. … Read more

Type Conversion in JavaScript

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 any numbers, literals, variables or expressions. Consider the examples given below: … Read more