Skip to content

Instantly share code, notes, and snippets.

@solomon081
Created June 2, 2012 17:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save solomon081/2859244 to your computer and use it in GitHub Desktop.
Save solomon081/2859244 to your computer and use it in GitHub Desktop.
Sin Calculator
<html>
<head>
<script type="text/javascript">
window.onload = function() {
document.getElementsByTagName("form")[0].onsubmit = function() {
document.getElementsByTagName("body")[0].style.color = "Red";
document.getElementsByTagName("input")[1].value = "Calculating...";
var inputted = Number(document.getElementsByTagName("input")[0].value);
inputted /= 57.295779501;
alert(Math.sin(inputted));
}
}
</script>
<style type=text/css>
body {font-family: "helvetica";}
</style>
</head>
<body>
<form>
<h1>Sin Calculator</h1>
Number: <input type="text"></input>
<input type="submit" value="Calculate"/>
<p></p>
</form>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment