I have some input text fields and I assigning id “parent_number and row_number” dynamically with jQuery to it when press button of addMore.
<input type="text" name="xpath" id="xpath_chield_'+parent_number+'_'+row_number+'" size="50"/>
it’s out put in browser is
<input id="xpath_chield_2_3" type="text" size="50" name="xpath">
This works fine
After deleting one input field I want to update only “parent_number” to -1 from current parent_number of id but not “row_number”
After update it will output in browser will
<input id="xpath_chield_1_3" type="text" size="50" name="xpath">
How can I do it with jQuery?
Thanks
You could reduce that portion of the ID like this:
Demo: http://jsbin.com/ifivor/edit#javascript (Console output)