Fetching contributors…
Cannot retrieve contributors at this time
35 lines (29 sloc) 703 Bytes
body {
padding: 50px;
font: 14px Helvetica, Arial;
label {
display: block;
clear: both;
<p>Click any of the items below to edit inline:</p>
<li data-editable='/item/1'>One</li>
<li data-editable='/item/2'>Two</li>
<li data-editable='/item/3'>Three</li>
<script src="./reactive.js"></script>
var reactive = require('reactive');
var view = reactive(document.querySelector('ul'));
view.bind('data-editable', function(el, url){
el.setAttribute('contenteditable', 'true');
el.onblur = function(){
var str = el.textContent;
console.log('save "%s" to %s', str, url);