Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Loops

5,595 views

Published on

esfdefdsfdf

Published in: Career
  • Be the first to comment

  • Be the first to like this

Loops

  1. 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. 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. 3. When you click on the link, it presents an alert box
  4. 4. Click inside the input type and press spacebar on your keyboard, a selection should appear, choose onmouseover.
  5. 5. Click inside the input type and press spacebar on your keyboard, a selection should appear, choose onmouseover.
  6. 6. Enter the following=> onmouseover=alert("hello") *click on liveview at the top of dreamweaver and see what happens.
  7. 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

×