.find not working jQuery -


i'm working on small project here reason keep getting error in console "error $li.find not function". code below

$orders.delegate('.saveorder', 'click', function(){     var $li = (this).closest('li');     var order = {         name: $li.find('input.name').val(),         drink: $li.find('input.drink').val()     };             $.ajax({         type: 'put',         url: 'http://rest.learncode.academy/api/johnbob/friends' + $li.attr('data-id'),         data: order,         success: function (neworder) {             $li.find('span.name').html(order.name);             $li.find('span.drink').html(order.drink);             $li.removeclass('edit');         },         error: function(){             alert('error adding order');         }     }); 

the problem occurs when creating order object. have been using find along no problems keeps throwing type-error saying find not function. appreciated.

don't mean $(this) not (this)? otherwise, domelement, not jquery object.


Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -