SlideShare a Scribd company logo
JAVA Script
For output
•<html>
•<body>
•<p id=“FA"></p>
•<script>
•document.getElementById(“FA").innerHTML = "Hello world.";
•document.write(“hellow world”)
•</script>
•</body>
•</html>
Operators
•<html>
• <body>
• <p id=“FA"></p>
• <script>
• var x = 5;
• y = 2;
• var z = x * y;
• document.write(z)
• document.getElementById(“FA").innerHTML = z;
• </script>
• </body>
•</html>
Conditions
• <html> <script>
• x=10;
• y=40;
• z=50;
• if(x>y&&x>z)
• document.write("x is greatest");
• else if(y>z&&y>x)
• document.write("y is greatest");
• else
• document.write("z is greatest")
• </script> </hmtl>
Conditions
• <html><body><script>
• number=prompt("enter value");
• if(number>=90)
• document.write("A+ grade")
• else if(number>=80)
• document.write("A grade")
• else if(number>=70)
• document.write("B grade")
• else if(number>=65)
• document.write("C grade")
• else
• document.write("Fail")
• </script></body></html>
Switch
• switch(n)
• {
• case n:
• -------context-------
• break;
• case n:
• --------context------
• break;
• default:
• -------context--------
• }
Loops• <html><body>
• <script>
• for(i=0;i<=10;i++)
• {
• document.write(“we are students of bscs”)
• }
• </script>
• </body></html>
Loops• <html><body>
• <script>
• i=o;
• while (i <= 10)
• {
• document.write(“we are students of bscs”)
• i++;
• }
• </script>
• </body></html>
Loops• <html><body>
• <script>
• i=o;
• do
• {
• document.write(“we are students of bscs”)
• i++;
• }
• while (i <= 10)
• </script>
• </body></html>
Functions
function name(parameters)
{
-----body-------
}
name(parameters);
Functions
No Return Type
No Parameters
Return type
Parameters
No Return Type
Parameters
Return Type
No Parameters
Functions
• <html> <body>
<script>
• function fa()
• {
• document.write(“hellow world”);
• }
• fa();
• </script>
• </body> </html>
NO RT
NO PM
Functions
• <html> <body>
• <script>
• function fa(a)
• {
• document.write(a);
• }
• b=10
• fa(b);
• </script>
• </body> </html>
NO RT
PM
Functions
• <html><body>
• <p id="fn"></p>
• <script>
• function fa()
• {
• x=10
• y=20
• return x * y;
• }
• document.getElementById("fn").innerHTML = fa();
• </script>
• </body> </html>
RT
NO PM
Functions
• <html><body>
• <p id="fn"></p>
• <script>
• function fa(x, y)
• {
• return x * y;
• }
• document.getElementById("fn").innerHTML = fa(4,4);
</script>
• </body></html>
RT
PM
Arrays
• <html>
• <script>
• y= new Array(“Mussadiq”,”Arslan, ””Umer”,”Ahmad”,”Asad”,”Saad”)
• x=[“Mussadiq”,”Arslan, ””Umer”,”Ahmad”,”Asad”,”Saad”)
• document.write(x[1])
• x[1]=“Farhan“
• </script>
• </html>
Operators
Operators

More Related Content

PPTX
Session 3 Java Script
PPTX
Java Script
PPTX
Web designing unit 4
PPT
Java script
PDF
JAVA SCRIPT
PPT
Java script
PPT
Java script
PPTX
Java Script
Session 3 Java Script
Java Script
Web designing unit 4
Java script
JAVA SCRIPT
Java script
Java script
Java Script

What's hot (20)

PPT
Java script
PPTX
Java script
PPT
JavaScript
PPTX
1. java script language fundamentals
PPTX
Internet and Web Technology (CLASS-9) [React.js] | NIC/NIELIT Web Technology
PPTX
Java script Session No 1
PDF
Intro to Javascript and jQuery
PPT
KMUTNB - Internet Programming 4/7
PPT
JavaScript - Part-1
PDF
Intro to jQuery
PPT
A quick guide to Css and java script
PPTX
Javascript
PDF
22 j query1
PDF
Web Projects: From Theory To Practice
PPT
JavaScript: Ajax & DOM Manipulation
PPT
Begin scripting
PPTX
Internet and Web Technology (CLASS-10) [Node.js] | NIC/NIELIT Web Technology
PPT
Javascript: Ajax & DOM Manipulation v1.2
PPT
HTML Introduction
PDF
Introduction to html & css
Java script
Java script
JavaScript
1. java script language fundamentals
Internet and Web Technology (CLASS-9) [React.js] | NIC/NIELIT Web Technology
Java script Session No 1
Intro to Javascript and jQuery
KMUTNB - Internet Programming 4/7
JavaScript - Part-1
Intro to jQuery
A quick guide to Css and java script
Javascript
22 j query1
Web Projects: From Theory To Practice
JavaScript: Ajax & DOM Manipulation
Begin scripting
Internet and Web Technology (CLASS-10) [Node.js] | NIC/NIELIT Web Technology
Javascript: Ajax & DOM Manipulation v1.2
HTML Introduction
Introduction to html & css
Ad

Similar to Java script programs (20)

PDF
Using Apache Solr
TXT
Pp checker
PPT
JavaScript Training
PPTX
Introduction to PHP
PPTX
JavaScriptL18 [Autosaved].pptx
KEY
前端概述
PDF
Javascript basic programs
PDF
Selenium再入門
PDF
Practical PHP by example Jan Leth-Kjaer
TXT
Ip lab
PDF
Code Management
ODP
Html5 101
KEY
Client-side Transformations
PDF
Html5 101
PDF
Web technology lab manual
PDF
Beyond Cookies, Persistent Storage For Web Applications Web Directions North ...
PDF
Wt unit 4 server side technology-2
PDF
Wt unit 2 ppts client side technology
Using Apache Solr
Pp checker
JavaScript Training
Introduction to PHP
JavaScriptL18 [Autosaved].pptx
前端概述
Javascript basic programs
Selenium再入門
Practical PHP by example Jan Leth-Kjaer
Ip lab
Code Management
Html5 101
Client-side Transformations
Html5 101
Web technology lab manual
Beyond Cookies, Persistent Storage For Web Applications Web Directions North ...
Wt unit 4 server side technology-2
Wt unit 2 ppts client side technology
Ad

More from ITz_1 (7)

PPTX
Data Mining in Operating System
PPTX
Software designm complexity
PPTX
Linux operating system
PPTX
Embedded Software
PPT
PCI
PPTX
5 major social institutions
PPTX
Class selectors
Data Mining in Operating System
Software designm complexity
Linux operating system
Embedded Software
PCI
5 major social institutions
Class selectors

Recently uploaded (20)

PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PDF
Sports Quiz easy sports quiz sports quiz
PPTX
Lesson notes of climatology university.
PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PDF
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PPTX
PPH.pptx obstetrics and gynecology in nursing
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PDF
Pre independence Education in Inndia.pdf
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PPTX
Institutional Correction lecture only . . .
PPTX
BOWEL ELIMINATION FACTORS AFFECTING AND TYPES
PPTX
master seminar digital applications in india
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PDF
01-Introduction-to-Information-Management.pdf
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
Sports Quiz easy sports quiz sports quiz
Lesson notes of climatology university.
Renaissance Architecture: A Journey from Faith to Humanism
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PPH.pptx obstetrics and gynecology in nursing
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
O5-L3 Freight Transport Ops (International) V1.pdf
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
Pre independence Education in Inndia.pdf
FourierSeries-QuestionsWithAnswers(Part-A).pdf
Institutional Correction lecture only . . .
BOWEL ELIMINATION FACTORS AFFECTING AND TYPES
master seminar digital applications in india
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
01-Introduction-to-Information-Management.pdf
Abdominal Access Techniques with Prof. Dr. R K Mishra
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
STATICS OF THE RIGID BODIES Hibbelers.pdf

Java script programs