properties-source.mustache revision 3e6a3b2c757d9137fa6f80d05b85fd282c2d55b6
<form id="demo" action="#">
<label>Width:</label>
<input name="width" size="2">
<input type="submit" value="Run">
</form>
<script type="text/javascript">
YUI().use('node', function(Y) {
var form = Y.one('#demo'),
input = Y.one('#demo input[name=width]'),
button = Y.one('#demo input[type=submit]');
button.on('click', function(e) {
e.preventDefault(); // keep the form from submitting
var value = input.get('value'),
width = form.get('offsetWidth');
if (value == '') {
input.set('value', width);
} else {
form.set('offsetWidth', value);
}
});
});
</script>