embark-area-51/demo/app/js/index.js

20 lines
488 B
JavaScript
Raw Normal View History

2015-05-24 13:07:19 +00:00
$(document).ready(function() {
$("button.set").click(function() {
var value = parseInt($("input.text").val(), 10);
SimpleStorage.set(value);
addToLog("SimpleStorage.set("+value+")");
});
document.getElementsByClassName("get")[0].addEventListener('click', function() {
var value = SimpleStorage.get().toNumber();
$(".value").html(value);
addToLog("SimpleStorage.get()");
});
var addToLog = function(txt) {
$(".logs").append("<br>" + txt);
}
});