embark/demo/app/js/index.js

20 lines
442 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+")");
});
2016-05-23 15:10:24 +00:00
$("button.get").click(function() {
2015-05-24 13:07:19 +00:00
var value = SimpleStorage.get().toNumber();
$(".value").html(value);
addToLog("SimpleStorage.get()");
});
var addToLog = function(txt) {
$(".logs").append("<br>" + txt);
}
});