Reputation: 1025
I set up a function that gets the name attribute of an object and runs a function. The name of the object is set up as a variable but it's not working when I called it. What am I missing?
http://jsfiddle.net/rexonms/wPUhK/1/
Upvotes: 0
Views: 36
Reputation: 324640
Firstly your call to parent()
is only getting you the <p>
containing the link, not the element you want. Either add a second .parent()
, or use a more suitable function for finding a specific container.
Second, your selector should be: $('[name='+completed+']')
Upvotes: 2