0% found this document useful (0 votes)
24 views

UNIT-I All Programs Basics of JavaScript Programming

Uploaded by

pawarjagdish019
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views

UNIT-I All Programs Basics of JavaScript Programming

Uploaded by

pawarjagdish019
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 26

<html>

<body>
<script language="javascript" type="text/javascript">
document.write("Welcome to world of JavaScript");
</script>
</body>
</html>

c h
Te
VJ
<html>
<body>
<script language="javascript" type="text/javascript">
document.write("********BIO-DATA*********");
document.write("<br>Name: Vishal Laxman Jadhav");
document.write("<br>Address: Tuljapur");
document.write("<br>Mobile No: 9730087674");

document.write("<br>Education: MTech in Computer Engineer");


document.write("<br>Job: Working in IT industry");
</script>
</body>
</html>

c h
Te
VJ
<html>
<body>
<script language="javascript" type="text/javascript">
var no=4;
function CalcSqaure()
{
var square;
square=no*no;
document.write("Square of given number="+square);
}
CalcSqaure();
</script>
</body>
</html>

c h
Te
VJ
<html>
<body>
<script language="javascript" type="text/javascript">
var basic_salary=1000,TA,DA,HRA,gross_Salary;
TA=(basic_salary*5)/100;
DA=(basic_salary*10)/100;
HRA=(basic_salary*15)/100;
gross_Salary=(basic_salary+TA+DA+HRA);
document.write("*******************************************");
document.write("<br>*********VJTECH SOFTWARE PVT
LTD***********");

document.write("<br>*******************************************");
document.write("<br>EMPLOYEE NAME:VISHAL LAXMAN JADHAV");
document.write("<br>EMPLOYEE ID: 57579");
document.write("<br>BASIC SALARY:"+basic_salary);
document.write("<br>TA ALLOWANCE:"+TA);
document.write("<br>DA ALLOWANCE:"+DA);
document.write("<br>HRA ALLOWANCE:"+HRA);

document.write("<br>============================================");
document.write("<br>Gross Salary:"+gross_Salary);
</script> h
</body>
</html>
c
Te
VJ
<html>
<body>
<script language="javascript" type="text/javascript">
var phy=78,che=88,maths=99,css=92,os=23,total,avg;
total=(phy+che+maths+css+os);
avg=total/5;
document.write("<br>***********************************");
document.write("<br>********VJTECH ENGG COLLEGE********");
document.write("<br>***********************************");
document.write("<br><br>STUDENT NAME: BRENDEN EICH");
document.write("<br>STUDENT ROLL NO : 101010");
document.write("<br>Physics Marks :"+phy);
document.write("<br>Chemistry Marks :"+che);
document.write("<br>Maths Marks :"+maths);
document.write("<br>CSS Marks :"+css);
document.write("<br>OS Marks :"+os);
document.write("<br>=====================================");
document.write("<br>Total Marks :"+total);
document.write("<br>Average Marks :"+avg);
</script>
</body>
</html> c h
Te
VJ
<html>
<body>
<script language="javascript" type="text/javascript">
var a=10,b=5,c;
c=a+b;
document.write("Addition="+c);
c=a-b;
document.write("<br>Subtraction="+c);
c=a*b;
document.write("<br>Multiplication="+c);
c=a/b;
document.write("<br>Division="+c);
c=a%b;
document.write("<br>Remainder="+c);
a++;
document.write("<br>After increment value of a="+a);
b--;
document.write("<br>After decrement value of b="+b);
</script>
</body>
</html>
c h
Te
VJ
<html>
<body>
<script language="javascript" type="text/javascript">
document.write("<br>10<20 :"+(10<20));
document.write("<br>10>20 :"+(10>20));
document.write("<br>10<=20 :"+(10<=20));
document.write("<br>10>=20 :"+(10>=20));
document.write("<br>10==20 :"+(10==20));
document.write("<br>10!=20 :"+(10!=20));
document.write("<br>10===10 :"+(10===10));
document.write("<br>10!==10 :"+(10!==10));
</script>
</body>
</html>

c h
Te
VJ
<html>
<body>
<script language="javascript" type="text/javascript">
var a=10,b=5;
document.write("<br>Value of a="+a+" and Value of b="+b);
document.write("<br>a+=b : "+(a+=b)); //a=15 b=5
document.write("<br>a-=b : "+(a-=b)); //a=10 b=5
document.write("<br>a*=b : "+(a*=b)); //a=50 b=5
document.write("<br>a/=b : "+(a/=b)); //a=10 b=5
document.write("<br>a%=b : "+(a%=b)); //a=0 b=5
</script>
</body>
</html>

c h
Te
VJ
<html>
<body>
<script language="javascript" type="text/javascript">
var a=100;
var b=500;
var c;
c=(a>b)?a:b;
document.write("Greatest Number="+c);
</script>
</body>
</html>

c h
Te
VJ
<html>
<body>
<script language="javascript" type="text/javascript">
var age=10;
if(age>18)
{
document.write("Qualifies for Driving");
}
</script>
</body>
</html>

c h
Te
VJ
<html>
<body>
<script language="javascript" type="text/javascript">
var age=20;
if(age>18)
{
document.write("Qualifies for Driving");
}
else
{
document.write("Not Qualifies for Driving");
}
</script>
</body>
</html>

c h
Te
VJ
<html>
<body>
<script language="javascript" type="text/javascript">
var marks=27;
if(marks>=75)
{
document.write("You got Distinction");
}
else if(marks>=60)
{
document.write("You got First Class");
}
else if(marks>=40)
{
document.write("You are Pass Only");
}
else
{
document.write("You are Fail");
}
</script>
</body>
</html> h
c
Te
VJ
<html>
<body>
<script language="javascript" type="text/javascript">
var a=100,b=5000,c=7000;
if(a>b)
{
if(a>c)
{
document.write("Greatest Number:"+a);
}
else
{
document.write("Greatest Number:"+c);
}
}
else
{
if(b>c)
{
document.write("Greatest Number:"+b);
}
else
{ h
document.write("Greatest Number:"+c);
}
c
}
</script>
Te

</body>
</html>
VJ
<html>
<body>
<script language="javascript" type="text/javascript">
var no=5;
switch(no)
{
case 1: document.write("Input Number is ONE");
break;
case 2: document.write("Input Number is TWO");
break;
case 3: document.write("Input Number is THREE");
break;
default:document.write("Invalid Input");
}
</script>
</body>
</html>

c h
Te
VJ
<html>
<body>
<script language="javascript" type="text/javascript">
var i=1;
while(i<=5)
{
document.write("<br>VJTech Academy");
i++;
}
</script>
</body>
</html>

c h
Te
VJ
<html>
<body>
<script language="javascript" type="text/javascript">
var i;
for(i=1;i<=5;i++)
{
document.write("<br>VJTech Academy");
}
</script>
</body>
</html>

c h
Te
VJ
<html>
<body>
<script type = "text/javascript">
var x;
document.write("document Object Properties<br>");
for (x in document)
{
document.write(x);
document.write("<br>");
}
</script>
</body>
</html>

c h
Te
VJ
<html>
<body>
<script language="javascript" type="text/javascript">
var i=1;
do
{
document.write("<br>VJTech Academy:"+i);
i++;
}while(i<=5);
</script>
</body>
</html>

c h
Te
VJ
<html>
<body>
<script type = "text/javascript">
var i;
for(i=1;i<=5;i++)
{
if(i==3)
{
break;
}
document.write(i+"<br>");
}
</script>
</body>
</html>

c h
Te
VJ
<html>
<body>
<script type = "text/javascript">
var i;
for(i=1;i<=5;i++)
{
if(i==3)
{
continue;
}
document.write(i+"<br>");
}
</script>
</body>
</html>

c h
Te
VJ
<html>
<body>
<script language="javascript" type="text/javascript">
document.write("<br>10>5&&5<5 : "+(10>5&&5<5));
document.write("<br>10>5||5<5 : "+(10>5||5<5));
document.write("<br>!(10>5) : "+!(10>5));
</script>
</body>
</html>

c h
Te
VJ
<html>
<body>
<script language="javascript" type="text/javascript">
document.write("<br>4&6 : "+(4&6));
document.write("<br>4|6 : "+(4|6));
document.write("<br>4^6 : "+(4^6));
document.write("<br>14<<2 : "+(14<<2));
document.write("<br>14>>2 : "+(14>>2));
document.write("<br>~14: "+(~14));
</script>
</body>
</html>

c h
Te
VJ
<html>
<body>
<script language="javascript" type="text/javascript">
var Student={
rollno:1010,
name:"Dennis",
marks:89.90
}
document.write("<brs>Roll No:"+Student.rollno);
document.write("<br>Name:"+Student.name);
document.write("<br>Marks:"+Student.marks);
</script>
</body>
</html>

c h
Te
VJ
<html>
<body>
<script language="javascript" type="text/javascript">
var Book={
book_id:1010,
book_name:"C Lang",
author_name:"Dennis",
book_price:950.50
};
document.write("******BOOK INFORMATION********");
document.write("<br>Book ID:"+Book.book_id);
document.write("<br>Book Name:"+Book.book_name);
document.write("<br>Author Name:"+Book.author_name);
document.write("<br>Book Price:"+Book['book_price']);
</script>
</body>
</html>

c h
Te
VJ
<html>
<body>
<script language="javascript" type="text/javascript">
var Student={
rollno:1010,
name:"Dennis",
marks:98.90,
get getName()
{
return this.name;
},
set putName(str1)
{
this.name=str1;
}
};
document.write("<br>Student Name:"+Student.getName);
Student.putName="Brenden";
document.write("<br>Student New Name:"+Student.getName);
</script>
</body>
</html> c h
Te
VJ
<html>
<body>
<script language="javascript" type="text/javascript">
var person={
firstname:"Dennis",
lastname:"Ritchie"
};
with(person)
{
document.write(firstname);
document.write(lastname);
}
</script>
</body>
</html>

c h
Te
VJ

You might also like