A Pen by Cyril Celestine on CodePen.
Created
January 13, 2014 21:17
-
-
Save nola/8408356 to your computer and use it in GitHub Desktop.
A Pen by Cyril Celestine.
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
<button>update</button> | |
<input type="text" value="10" /> <br /> | |
<label></label> |
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(){ | |
var model = function(){ | |
return { | |
prop: function () { | |
return $('input').val(); | |
} | |
} | |
}(); | |
$('button').click(function(){ | |
$('label').text(model.prop) | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment