Jump to content

Recommended Posts

Posted

This is supposed to insert the "item[value]" into the third input in a form but it's not. I'm clearly using "find("input", 3)" incorrectly, I was trying and hoping it would work like this, but it actually only finds the first element. And when I use it properly and remove the 3, it sets the value in all the inputs. How can I rewrite this to find "X" index position element in the "$(this).closest(".item-row")" and set what I need to?

$(this).closest(".item-row").find("input", 3).attr("value", item["value"]);

Thanks.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...