SlideShare ist ein Scribd-Unternehmen logo
1 von 18
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

Weitere ähnliche Inhalte

Was ist angesagt?

Intro to Javascript and jQuery
Intro to Javascript and jQueryIntro to Javascript and jQuery
Intro to Javascript and jQuery
Shawn Calvert
 

Was ist angesagt? (20)

Java script
Java scriptJava script
Java script
 
Java script
Java scriptJava script
Java script
 
JavaScript
JavaScriptJavaScript
JavaScript
 
1. java script language fundamentals
1. java script language fundamentals1. java script language fundamentals
1. java script language fundamentals
 
Internet and Web Technology (CLASS-9) [React.js] | NIC/NIELIT Web Technology
Internet and Web Technology (CLASS-9) [React.js] | NIC/NIELIT Web TechnologyInternet and Web Technology (CLASS-9) [React.js] | NIC/NIELIT Web Technology
Internet and Web Technology (CLASS-9) [React.js] | NIC/NIELIT Web Technology
 
Java script Session No 1
Java script Session No 1Java script Session No 1
Java script Session No 1
 
Intro to Javascript and jQuery
Intro to Javascript and jQueryIntro to Javascript and jQuery
Intro to Javascript and jQuery
 
KMUTNB - Internet Programming 4/7
KMUTNB - Internet Programming 4/7KMUTNB - Internet Programming 4/7
KMUTNB - Internet Programming 4/7
 
JavaScript - Part-1
JavaScript - Part-1JavaScript - Part-1
JavaScript - Part-1
 
Intro to jQuery
Intro to jQueryIntro to jQuery
Intro to jQuery
 
A quick guide to Css and java script
A quick guide to Css and  java scriptA quick guide to Css and  java script
A quick guide to Css and java script
 
Javascript
JavascriptJavascript
Javascript
 
22 j query1
22 j query122 j query1
22 j query1
 
Web Projects: From Theory To Practice
Web Projects: From Theory To PracticeWeb Projects: From Theory To Practice
Web Projects: From Theory To Practice
 
JavaScript: Ajax & DOM Manipulation
JavaScript: Ajax & DOM ManipulationJavaScript: Ajax & DOM Manipulation
JavaScript: Ajax & DOM Manipulation
 
Begin scripting
Begin scriptingBegin scripting
Begin scripting
 
Internet and Web Technology (CLASS-10) [Node.js] | NIC/NIELIT Web Technology
Internet and Web Technology (CLASS-10) [Node.js] | NIC/NIELIT Web Technology Internet and Web Technology (CLASS-10) [Node.js] | NIC/NIELIT Web Technology
Internet and Web Technology (CLASS-10) [Node.js] | NIC/NIELIT Web Technology
 
Javascript: Ajax & DOM Manipulation v1.2
Javascript: Ajax & DOM Manipulation v1.2Javascript: Ajax & DOM Manipulation v1.2
Javascript: Ajax & DOM Manipulation v1.2
 
HTML Introduction
HTML IntroductionHTML Introduction
HTML Introduction
 
Introduction to html & css
Introduction to html & cssIntroduction to html & css
Introduction to html & css
 

Ähnlich wie Java script programs

Ähnlich wie Java script programs (20)

PHP 1
PHP 1PHP 1
PHP 1
 
jQuery basics
jQuery basicsjQuery basics
jQuery basics
 
Using Apache Solr
Using Apache SolrUsing Apache Solr
Using Apache Solr
 
Pp checker
Pp checkerPp checker
Pp checker
 
JavaScript Training
JavaScript TrainingJavaScript Training
JavaScript Training
 
Introduction to PHP
Introduction to PHPIntroduction to PHP
Introduction to PHP
 
JavaScriptL18 [Autosaved].pptx
JavaScriptL18 [Autosaved].pptxJavaScriptL18 [Autosaved].pptx
JavaScriptL18 [Autosaved].pptx
 
前端概述
前端概述前端概述
前端概述
 
1cst
1cst1cst
1cst
 
Javascript basic programs
Javascript basic programsJavascript basic programs
Javascript basic programs
 
Selenium再入門
Selenium再入門Selenium再入門
Selenium再入門
 
Practical PHP by example Jan Leth-Kjaer
Practical PHP by example   Jan Leth-KjaerPractical PHP by example   Jan Leth-Kjaer
Practical PHP by example Jan Leth-Kjaer
 
Ip lab
Ip labIp lab
Ip lab
 
Code Management
Code ManagementCode Management
Code Management
 
Html5 101
Html5 101Html5 101
Html5 101
 
Client-side Transformations
Client-side TransformationsClient-side Transformations
Client-side Transformations
 
Html5 101
Html5 101Html5 101
Html5 101
 
Web technology lab manual
Web technology lab manualWeb technology lab manual
Web technology lab manual
 
Beyond Cookies, Persistent Storage For Web Applications Web Directions North ...
Beyond Cookies, Persistent Storage For Web Applications Web Directions North ...Beyond Cookies, Persistent Storage For Web Applications Web Directions North ...
Beyond Cookies, Persistent Storage For Web Applications Web Directions North ...
 
Wt unit 4 server side technology-2
Wt unit 4 server side technology-2Wt unit 4 server side technology-2
Wt unit 4 server side technology-2
 

Mehr von ITz_1 (7)

Data Mining in Operating System
Data Mining in Operating SystemData Mining in Operating System
Data Mining in Operating System
 
Software designm complexity
Software designm complexitySoftware designm complexity
Software designm complexity
 
Linux operating system
Linux operating systemLinux operating system
Linux operating system
 
Embedded Software
Embedded SoftwareEmbedded Software
Embedded Software
 
PCI
PCIPCI
PCI
 
5 major social institutions
5 major social institutions5 major social institutions
5 major social institutions
 
Class selectors
Class selectorsClass selectors
Class selectors
 

Kürzlich hochgeladen

Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
KarakKing
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 

Kürzlich hochgeladen (20)

REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
OSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsOSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & Systems
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
Plant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxPlant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptx
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 

Java script programs