Created
October 17, 2016 12:53
-
-
Save naoto-ogawa/32fba9e846148ed91892e475d2d2df50 to your computer and use it in GitHub Desktop.
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |
</head> | |
<script src="http://cdn.cloudwall.me/1.2/minimal.js"></script> | |
<body | |
<form id="myform"> | |
name<input type="text" id="name"> | |
age<input type="text" id="age"> | |
<input type="button" id="btn" value="log"> | |
</form> | |
<hr> | |
name <input type="text" id="inname"> | |
<br> | |
age <input type="text" id="inage"> | |
</body> | |
<script> | |
var person = { | |
name : "ogawa", | |
age : 13 , | |
}; | |
var manifest = { | |
"ui":{ | |
"#name": { bind: "name" }, | |
"#age" : { bind: "age" } | |
} | |
}; | |
$("#myform").my(manifest, person); | |
$("#btn").on('click', function(){console.log(person)}); | |
$("#inname").on('keyup', function(){ | |
person.name = $("#inname").val(); | |
$("#myform").my("redraw"); | |
}); | |
$("#inage").on('keyup', function(){ | |
person.age = $("#inage").val(); | |
$("#myform").my("redraw"); | |
}); | |
</script> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment