Advertisement
Guest User

Untitled

a guest
Mar 31st, 2013
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 0.96 KB | None | 0 0
  1. <html>
  2. <head>
  3.   <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  4.   <meta name="language" content="en" />
  5.   <meta http-equiv="content-language" content="en" />
  6.   <title>Test</title>
  7.   <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
  8. </head>
  9. <body>
  10. <script>
  11. function calcul() {
  12. var total = parseInt($('#studenttut option:selected').val()) +
  13.     parseInt($('#campusrb>option:selected').val()) *
  14.     parseInt($('#yearsatten>option:selected').val());
  15.     $("#total").text(total);
  16. }
  17. </script>
  18. <select id="studenttut">
  19.   <option value="5">5</option>
  20.   <option value="10">10</option>
  21. </select>
  22. <select id="campusrb">
  23.   <option value="0">0</option>
  24.   <option value="1">1</option>
  25. </select>
  26. <select id="yearsatten">
  27.   <option value="1">1</option>
  28.   <option value="2">2</option>
  29. </select>
  30. <input type="button" onClick="calcul()" value="calcul"/>
  31. <div id="total">total</div>
  32. </body>
  33. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement