Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
01-28-2012, 09:46 PM #1
- Join Date
- Jun 2008
- New Jersey
- Thanked 259 Times in 256 Posts
Binding functions on click to dynamically added elements
Basically I've got a list of skills, and I'm making a POST call to add a new skill to the DB, and the page that inserts the skill, returns the HTML for the skill and the input elements to describe level of efficiency, wrapped in a div with the class "skill". I want to bind a function to the inputs on change to modify an image, but I'm not sure if selecting all the skill elements ($('.skill input')) or if I should select the last skill set, then use find to get the inputs and bind specifically to the new inputs.
Which would be the better way to do it? I'm guessing the latter, but I donno if trying to find the the last item would be worse off, or if binding to all is worst, but not by enough to make a big difference.