Mic starts working but doesnt add to list item, also manual adding of list item using the form adds it for a second and then drops it



My microphone is working with Annyang but isnt adding a list item. Additionally when i use the form and submit a manual typed list item it sticks for a split second and disappears. Can someone take a look at my code?

jQuery -

    var template = function(text) {
      return '<p><input type="checkbox"><i class="glyphicon glyphicon-star"></i><span>' + text + '</span><i class="glyphicon glyphicon-remove"></i></p>';

var main = function() {
  $('form').submit(function() {
     var text = $('#todo').val();
    var html = template(text);
         var commands = {
           'add *item': add 
     var add = function(item) {
       var html = template(item);



Hey dude,

Try to use If statement

if (annyang) {
var commands = you code… and the end don’t forget to close if statement