Skip to content

Instantly share code, notes, and snippets.

@garyshort
Created December 21, 2011 18:01
Show Gist options
  • Save garyshort/1507005 to your computer and use it in GitHub Desktop.
Save garyshort/1507005 to your computer and use it in GitHub Desktop.
Broken Knockout
<html>
<body>
<form data-bind="submit: onSubmit">
<button type="submit">Submit</button>
</form>
<script language="text/javascript" src="knockout-2.0.0.js"></script>
<script type="text/javascript">
var viewModel = {
onSubmit : function(formElement) {
alert('works');
}
};
ko.applyBindings(viewModel);
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment