Team:Harvard/Slider Test

From 2011.igem.org

(Difference between revisions)
Line 3: Line 3:
     <title>Really Awesome Webpage </title>
     <title>Really Awesome Webpage </title>
     <script type="text/javascript">
     <script type="text/javascript">
-
function square(){
+
$(document).ready(function(){
-
  var number=document.getElementById("box").value;
+
  $("button").click(function(){
-
  var output=number*number;
+
    var number=$("box").value;
-
  document.getElementById("paragraph1").innerHTML=output;
+
    var output=number*number;
-
}</script>
+
    $("paragraph1").innerHTML=output;
 +
  });
 +
});
 +
</script>
</head>
</head>
Line 19: Line 22:
<input id="box" type="text">
<input id="box" type="text">
<p id="paragraph1">This is a temporary paragraph.</p>
<p id="paragraph1">This is a temporary paragraph.</p>
-
<button type="button" onclick="square()">Display Square</button>
+
<button type="button">Display Square</button>
</body>
</body>
</html>
</html>

Revision as of 20:01, 7 July 2011

Really Awesome Webpage

My Really Awesome Website

iGEM 2011 baby!

This is another paragraph. Pretty cool, huh?

This is a temporary paragraph.