Skip to content

Instantly share code, notes, and snippets.

@naoto-ogawa
Created October 17, 2016 12:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save naoto-ogawa/32fba9e846148ed91892e475d2d2df50 to your computer and use it in GitHub Desktop.
Save naoto-ogawa/32fba9e846148ed91892e475d2d2df50 to your computer and use it in GitHub Desktop.
<!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