Reputation: 43
var deleteTarget = $('ul li .active');
deleteTarget.remove();
Not sure what's wrong, the console says it has no method
, or shall I still use $(deleteTarget)
?
Upvotes: 0
Views: 62
Reputation: 754
Can you try this one ???
$("ul li").remove(".active");
id try mixin up the codes from this site Here
Upvotes: 0
Reputation: 17888
Your jquery string is almost certainly wrong.
#
queries for ID
You probably wanted to do:
var deleteTarget = $('ul li .active');
Upvotes: 0
Reputation: 150263
$
is obviously not jQuery in your case.
You can check if it is with:
console.log($().jquery); // if undefined, it's not jQuery
Upvotes: 2