Skip to content

Instantly share code, notes, and snippets.

Created October 30, 2014 16:41
Show Gist options
  • Save anonymous/7a56466c655b70f8dfad to your computer and use it in GitHub Desktop.
Save anonymous/7a56466c655b70f8dfad to your computer and use it in GitHub Desktop.
Prototype created with Firefox DevTools Prototyper
<!DOCTYPE html>
<html>
<head>
<script>
var y = 1/2;
function funct(x) {
x = eval(x);
var result = x*x - (2*Math.cos(y)*x)-Math.pow((Math.sin(y)),2);
alert(result)
}
</script>
<style>
</style>
</head>
<body><title>Equation solver</title>
<form onsubmit="funct(document.querySelector('#x').value)">
<input type="text" id="x">
<input type="submit"/>
</form></body></html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment