Created
January 24, 2013 17:12
-
-
Save gsscoder/4625249 to your computer and use it in GitHub Desktop.
Simple MLState Opa Calculator.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function sum() | |
{ | |
a = Int.of_string(Dom.get_value(#vala)); | |
b = Int.of_string(Dom.get_value(#valb)); | |
#res = a + b; | |
} | |
function start() { | |
<div>EasyCalc</div> | |
<div> | |
<input id=#vala type="text"/> + <input id=#valb type="text"/> | |
= <p id=#res/> | |
<input type="button" value="Add" onclick={function(_) { sum()}}/> | |
</div> | |
} | |
Server.start( | |
Server.http, | |
[ {title: "Hello World", page:start} ] | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment