Native JavaScript Data-Binding
// FROM: http://www.sellarafaeli.com/blog/native_javascript_data_binding
function bindModelInput(obj, property, domElem) {
Object.defineProperty(obj, property, {
get: function() { return domElem.value; },
set: function(newValue) { domElem.value = newValue; },
configurable: true
});
}
//<input id="foo">
user = {}
bindModelInput(user,'name',document.getElementById('foo'));