Skip to content

Instantly share code, notes, and snippets.

@plusjade

plusjade/index.html

Last active Aug 29, 2015
Embed
What would you like to do?
<form>
<input name="item">
<button type="submit">Add Item</button>
</form>
<ul id="todo-items">
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ul>
<script>
// Now some unobtrusive javascript:
$('form').submit(function(e) {
e.preventDefault();
var content = $('form').find('input').val());
$("#todo-items").append($('<li></li>').text(content));
})
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.