SlideShare a Scribd company logo
Javascript- Functions
A function is a group of reusable code which can be called
anywhere in your program. This stops the need of writing the
same code again and again.
Copy the following code into
dreamweaver
<head> <script type="text/javascript">
function sayHello() {
alert("Hello World")
}
</script>
</head>
<body>
<input type="button" onclick="sayHello()" value="Say Hello" />
</body>
When you click on the link, it
presents an alert box
Click inside the input type and press spacebar
on your keyboard, a selection should appear,
choose onmouseover.
Click inside the input type and press spacebar
on your keyboard, a selection should appear,
choose onmouseover.
Enter the following=>
onmouseover=alert("hello")
*click on liveview at the top of dreamweaver and
see what happens.
Javascript: for Loop
the for loop makes a list of code copy over and over.
Open a new html page and copy the following into the body tag-
<script type="text/javascript">
var bodyslam= prompt("enter a number");
bodyslam= parseFloat(bodyslam);
if (bodyslam>= 200){
for(bodyslam=5;bodyslam<=5000000;bodyslam=bodyslam+30)
document.write("<PRE>hello </PRE> ");
}
else {
alert("not a high enough number, sorry")
} </script>
The value to enter
How many times it repeats

More Related Content

What's hot

Java script functions
Java script   functionsJava script   functions
Java script functions
chauhankapil
 
Javascript
JavascriptJavascript
Javascript
Nital Shingala
 
Java script
Java scriptJava script
Java script
shamim hasan
 
Training in Asp.net mvc3 platform-apextgi,noida
Training in Asp.net mvc3 platform-apextgi,noidaTraining in Asp.net mvc3 platform-apextgi,noida
Training in Asp.net mvc3 platform-apextgi,noida
prav068
 
Jbehave + serenity
Jbehave + serenityJbehave + serenity
Jbehave + serenity
Marina Viana
 
Java script functions
Java script   functionsJava script   functions
Java script functions
AbhishekMondal42
 
Functional testing with capybara
Functional testing with capybaraFunctional testing with capybara
Functional testing with capybara
koffeinfrei
 
Java script dialog boxes
Java script   dialog boxesJava script   dialog boxes
Java script dialog boxes
AbhishekMondal42
 
Html tag
Html tagHtml tag
6.copy text
6.copy text6.copy text
Ch2(working with forms)
Ch2(working with forms)Ch2(working with forms)
Ch2(working with forms)
Chhom Karath
 

What's hot (14)

Java script functions
Java script   functionsJava script   functions
Java script functions
 
Javascript
JavascriptJavascript
Javascript
 
Java script
Java scriptJava script
Java script
 
Training in Asp.net mvc3 platform-apextgi,noida
Training in Asp.net mvc3 platform-apextgi,noidaTraining in Asp.net mvc3 platform-apextgi,noida
Training in Asp.net mvc3 platform-apextgi,noida
 
Jbehave + serenity
Jbehave + serenityJbehave + serenity
Jbehave + serenity
 
Java script functions
Java script   functionsJava script   functions
Java script functions
 
Html5 use cases
Html5 use casesHtml5 use cases
Html5 use cases
 
aman's code
aman's codeaman's code
aman's code
 
Vijesh Pachatiyan 2016
Vijesh Pachatiyan 2016Vijesh Pachatiyan 2016
Vijesh Pachatiyan 2016
 
Functional testing with capybara
Functional testing with capybaraFunctional testing with capybara
Functional testing with capybara
 
Java script dialog boxes
Java script   dialog boxesJava script   dialog boxes
Java script dialog boxes
 
Html tag
Html tagHtml tag
Html tag
 
6.copy text
6.copy text6.copy text
6.copy text
 
Ch2(working with forms)
Ch2(working with forms)Ch2(working with forms)
Ch2(working with forms)
 

Viewers also liked

Lesson plan 1 mata 4
Lesson plan 1 mata 4Lesson plan 1 mata 4
Lesson plan 1 mata 4
Max Friel
 
Strings
StringsStrings
Strings
Max Friel
 
Lesson 4 maya 4
Lesson 4 maya 4Lesson 4 maya 4
Lesson 4 maya 4Max Friel
 
Mayores, Aaron James C. (resume) (1)
Mayores, Aaron James C. (resume) (1)Mayores, Aaron James C. (resume) (1)
Mayores, Aaron James C. (resume) (1)Aaron James Mayores
 
Human-machine Coexistence in Groups
Human-machine Coexistence in GroupsHuman-machine Coexistence in Groups
Human-machine Coexistence in Groups
Smart-Society-Project
 
Towards Hybrid and Diversity-Aware Collective Adaptive Systems
Towards Hybrid and Diversity-Aware Collective Adaptive SystemsTowards Hybrid and Diversity-Aware Collective Adaptive Systems
Towards Hybrid and Diversity-Aware Collective Adaptive Systems
Smart-Society-Project
 
iOS 10 & XCode 8, Swift 3.0 features and changes
iOS 10 & XCode 8, Swift 3.0 features and changesiOS 10 & XCode 8, Swift 3.0 features and changes
iOS 10 & XCode 8, Swift 3.0 features and changes
Manjula Jonnalagadda
 
iOS App Architecture
iOS App ArchitectureiOS App Architecture
iOS App Architecture
Manjula Jonnalagadda
 

Viewers also liked (18)

Lesson plan 1 mata 4
Lesson plan 1 mata 4Lesson plan 1 mata 4
Lesson plan 1 mata 4
 
Kahwin dah edit
Kahwin dah editKahwin dah edit
Kahwin dah edit
 
Strings
StringsStrings
Strings
 
Nota smart tkt1
Nota smart tkt1Nota smart tkt1
Nota smart tkt1
 
Kahwin dah edit
Kahwin dah editKahwin dah edit
Kahwin dah edit
 
Lesson 4 maya 4
Lesson 4 maya 4Lesson 4 maya 4
Lesson 4 maya 4
 
Linking
LinkingLinking
Linking
 
Kahwin dah edit
Kahwin dah editKahwin dah edit
Kahwin dah edit
 
Core dataperformancetips
Core dataperformancetipsCore dataperformancetips
Core dataperformancetips
 
Mayores, Aaron James C. (resume) (1)
Mayores, Aaron James C. (resume) (1)Mayores, Aaron James C. (resume) (1)
Mayores, Aaron James C. (resume) (1)
 
Saidatina aishah
Saidatina aishahSaidatina aishah
Saidatina aishah
 
Human-machine Coexistence in Groups
Human-machine Coexistence in GroupsHuman-machine Coexistence in Groups
Human-machine Coexistence in Groups
 
Web design
Web designWeb design
Web design
 
Towards Hybrid and Diversity-Aware Collective Adaptive Systems
Towards Hybrid and Diversity-Aware Collective Adaptive SystemsTowards Hybrid and Diversity-Aware Collective Adaptive Systems
Towards Hybrid and Diversity-Aware Collective Adaptive Systems
 
Dr. Deepthi
Dr. DeepthiDr. Deepthi
Dr. Deepthi
 
Saudatina aishah
Saudatina aishahSaudatina aishah
Saudatina aishah
 
iOS 10 & XCode 8, Swift 3.0 features and changes
iOS 10 & XCode 8, Swift 3.0 features and changesiOS 10 & XCode 8, Swift 3.0 features and changes
iOS 10 & XCode 8, Swift 3.0 features and changes
 
iOS App Architecture
iOS App ArchitectureiOS App Architecture
iOS App Architecture
 

Similar to Loops

wp-UNIT_III.pptx
wp-UNIT_III.pptxwp-UNIT_III.pptx
wp-UNIT_III.pptx
GANDHAMKUMAR2
 
4007655 introduction-to-javascript
4007655 introduction-to-javascript4007655 introduction-to-javascript
4007655 introduction-to-javascript
Vikash Chandra
 
Java script basic
Java script basicJava script basic
Java script basic
Vithushan Vinayagamoorthy
 
Java script
Java scriptJava script
Java script
Shyam Khant
 
Java script basics
Java script basicsJava script basics
Java script basics
John Smith
 
JavaScript Core fundamentals - Learn JavaScript Here
JavaScript Core fundamentals - Learn JavaScript HereJavaScript Core fundamentals - Learn JavaScript Here
JavaScript Core fundamentals - Learn JavaScript Here
Laurence Svekis ✔
 
Javascript talk1
Javascript talk1Javascript talk1
Javascript talk1
Pratik Kunpara
 
Javascript
JavascriptJavascript
Javascript
Nagarajan
 
1. java script language fundamentals
1. java script language fundamentals1. java script language fundamentals
1. java script language fundamentals
Rajiv Gupta
 
Introduction to java script Lecture 4.ppt
Introduction to java script Lecture 4.pptIntroduction to java script Lecture 4.ppt
Introduction to java script Lecture 4.ppt
dejen6
 
Java script
Java scriptJava script
Java script
Ravinder Kamboj
 
Javascript
JavascriptJavascript
Javascript
D V BHASKAR REDDY
 
Basic Java script handouts for students
Basic Java script handouts for students Basic Java script handouts for students
Basic Java script handouts for students
shafiq sangi
 
Debugging Javascript - 0 to Heisenberg
Debugging Javascript - 0 to HeisenbergDebugging Javascript - 0 to Heisenberg
Debugging Javascript - 0 to Heisenberg
Chris Morrow
 
1472251766_demojavascriptppt (1).ppt
1472251766_demojavascriptppt (1).ppt1472251766_demojavascriptppt (1).ppt
1472251766_demojavascriptppt (1).ppt
ictlab3
 
Reacting to a Virtual World
Reacting to a Virtual WorldReacting to a Virtual World
Reacting to a Virtual World
Jaime Christine Perez
 

Similar to Loops (20)

wp-UNIT_III.pptx
wp-UNIT_III.pptxwp-UNIT_III.pptx
wp-UNIT_III.pptx
 
4007655 introduction-to-javascript
4007655 introduction-to-javascript4007655 introduction-to-javascript
4007655 introduction-to-javascript
 
Java script basic
Java script basicJava script basic
Java script basic
 
Java script
Java scriptJava script
Java script
 
Java script basics
Java script basicsJava script basics
Java script basics
 
JavaScript Core fundamentals - Learn JavaScript Here
JavaScript Core fundamentals - Learn JavaScript HereJavaScript Core fundamentals - Learn JavaScript Here
JavaScript Core fundamentals - Learn JavaScript Here
 
Javascript talk1
Javascript talk1Javascript talk1
Javascript talk1
 
Javascript
JavascriptJavascript
Javascript
 
Print function in PHP
Print function in PHPPrint function in PHP
Print function in PHP
 
Java script
Java scriptJava script
Java script
 
Unit 2.4
Unit 2.4Unit 2.4
Unit 2.4
 
1. java script language fundamentals
1. java script language fundamentals1. java script language fundamentals
1. java script language fundamentals
 
Introduction to java script Lecture 4.ppt
Introduction to java script Lecture 4.pptIntroduction to java script Lecture 4.ppt
Introduction to java script Lecture 4.ppt
 
Java script
Java scriptJava script
Java script
 
Javascript
JavascriptJavascript
Javascript
 
Basic Java script handouts for students
Basic Java script handouts for students Basic Java script handouts for students
Basic Java script handouts for students
 
Java script
Java scriptJava script
Java script
 
Debugging Javascript - 0 to Heisenberg
Debugging Javascript - 0 to HeisenbergDebugging Javascript - 0 to Heisenberg
Debugging Javascript - 0 to Heisenberg
 
1472251766_demojavascriptppt (1).ppt
1472251766_demojavascriptppt (1).ppt1472251766_demojavascriptppt (1).ppt
1472251766_demojavascriptppt (1).ppt
 
Reacting to a Virtual World
Reacting to a Virtual WorldReacting to a Virtual World
Reacting to a Virtual World
 

More from Max Friel

Assum 4
Assum 4Assum 4
Assum 4
Max Friel
 
Assum 3
Assum 3Assum 3
Assum 3
Max Friel
 
Tourism
TourismTourism
Tourism
Max Friel
 
Practice programs
Practice programsPractice programs
Practice programs
Max Friel
 
Project 1
Project 1Project 1
Project 1
Max Friel
 
Practice and debugging
Practice and debuggingPractice and debugging
Practice and debugging
Max Friel
 
Debugging
DebuggingDebugging
Debugging
Max Friel
 
Loops
LoopsLoops
Loops
Max Friel
 
If conditions
If conditionsIf conditions
If conditions
Max Friel
 
Keywords used in javascript
Keywords used in javascriptKeywords used in javascript
Keywords used in javascriptMax Friel
 
Developing html skills 1
Developing html skills 1Developing html skills 1
Developing html skills 1Max Friel
 
Matching game
Matching gameMatching game
Matching gameMax Friel
 
activity flowcharts
activity flowchartsactivity flowcharts
activity flowchartsMax Friel
 
Summer course
Summer courseSummer course
Summer courseMax Friel
 

More from Max Friel (20)

Assum 4
Assum 4Assum 4
Assum 4
 
Assum 3
Assum 3Assum 3
Assum 3
 
Tourism
TourismTourism
Tourism
 
Practice programs
Practice programsPractice programs
Practice programs
 
Project 1
Project 1Project 1
Project 1
 
Practice and debugging
Practice and debuggingPractice and debugging
Practice and debugging
 
Debugging
DebuggingDebugging
Debugging
 
Loops
LoopsLoops
Loops
 
If conditions
If conditionsIf conditions
If conditions
 
Keywords used in javascript
Keywords used in javascriptKeywords used in javascript
Keywords used in javascript
 
Variables
VariablesVariables
Variables
 
Basics
BasicsBasics
Basics
 
Developing html skills 1
Developing html skills 1Developing html skills 1
Developing html skills 1
 
Matching game
Matching gameMatching game
Matching game
 
activity flowcharts
activity flowchartsactivity flowcharts
activity flowcharts
 
Lesson one
Lesson oneLesson one
Lesson one
 
Summer course
Summer courseSummer course
Summer course
 
Law
LawLaw
Law
 
Phishing
PhishingPhishing
Phishing
 
Id
IdId
Id
 

Loops

  • 1. Javascript- Functions A function is a group of reusable code which can be called anywhere in your program. This stops the need of writing the same code again and again.
  • 2. Copy the following code into dreamweaver <head> <script type="text/javascript"> function sayHello() { alert("Hello World") } </script> </head> <body> <input type="button" onclick="sayHello()" value="Say Hello" /> </body>
  • 3. When you click on the link, it presents an alert box
  • 4. Click inside the input type and press spacebar on your keyboard, a selection should appear, choose onmouseover.
  • 5. Click inside the input type and press spacebar on your keyboard, a selection should appear, choose onmouseover.
  • 6. Enter the following=> onmouseover=alert("hello") *click on liveview at the top of dreamweaver and see what happens.
  • 7. Javascript: for Loop the for loop makes a list of code copy over and over. Open a new html page and copy the following into the body tag- <script type="text/javascript"> var bodyslam= prompt("enter a number"); bodyslam= parseFloat(bodyslam); if (bodyslam>= 200){ for(bodyslam=5;bodyslam<=5000000;bodyslam=bodyslam+30) document.write("<PRE>hello </PRE> "); } else { alert("not a high enough number, sorry") } </script> The value to enter How many times it repeats