Prompt Box in JavaScript Prompt Box : it is same as alert and conform Box but the prompt box we can get a value or message from user./ to get a input from the user Example: <!DOCTYPE html> <html> <body> <script> prompt(” what is your name”); </script> </body> </html> Output: what is your name: xyz Continue reading
Programming Language
Conform Box JavaScript
Conform Box JavaScript Conform Box: it is same like, alert box but it will ask the question you need to give answer in terms of YES (true) or NO(false), if it is true, it will perform next operation Program: <!DOCTYPE html> <html> <body> <script> conform(” do you like our website”); alert(a); </script> </body> </html> Output: Continue reading
JavaScript Alert Box
JavaScript Alert Box Alert Box is actually to display a message or value, you can perform arithmetic operation, condition etc, Example1: <!DOCTYPE html> <html> <body> <script> alert(” Welcome to JavaScript”); </script> </body> </html> Output : Welcome to JavaScript Example2: <!DOCTYPE html> <html> <body> <script> var a=10; var b=20; alert(a+b); </script> </body> </html> Output: 30 Exampl3: Continue reading
Logical Operators in JavaScript
Logical Operators in JavaScript Logical Operators Logical Operators is used for applying two or more condition at a time in a single condition are used For example if a condition is true then it will return a statement, if a condition false out of the condition. There are three types of Logical Operators: && AND Continue reading
Airthmetic operator in JavaScript
Airthmetic operator in JavaScript The number which is called operands The operations between two operands are defined by operator Arithmetic operators are • Addition(+) the operations between two or more operands perform an Addition operation ( + ) Example : <!DOCTYPE html> <html> <body> <script> var a=18; var b=20; document.write(a+b); </script> </body> </html> Output: 38 Continue reading
JavaScript Data Types
JavaScript Data Types 1) String : which are used to store the data that involves the characters Example: var x=” Hello World”; Program: <!DOCTYPE html> <html> <body> <script> var x=”Hello world”; document.write(x); document.write(“<br>”); document.write(typeof x); </script> </body> </html> Output: Hello world String 2) Numbers : a numbers can be written with or without decimal Example Continue reading
JavaScript Comparison Operators
JavaScript Comparison Operators Comparison or Relation Operators : Comparison Operator which are used to compare two values between the operands or numbers. Comparison operators has only two values True False Operators Meaning Result Example < Less than 10<5 False > Greater than 10>5 True <= Less than or Equal to 10<=5 False >= Greater than Continue reading
Variables in JavaScript
Variables in JavaScript Variables in javascript: A javascript is simply a name of storage location, variables are case sensitive, there are three types of variables in javascript Var Let Const Var: a Variables is an identifier or a name which a user to refer a value Syntax: Var <Variable-name>; Var <Variable-name>=value; Example: <!DOCTYPE html> <html> Continue reading
JavaScript Comments
JavaScript Comments Comments : multiple lines of code temporally you want to close it, that time you can use it. If you are working n a team one of them had written a complex code, to understand other also n a team that time also use comment Comments are two types Single line comments Continue reading
JavaScript Introduction
JavaScript JavaScript is one of most popular and widely used programming languages, and growing faster than any other programming languages and components like Netflix and paypal to build a inter application around the javascript What can you do with JavaScript In the browser to build a interactive application Web/mobile apps Real time networking apps Games Continue reading