Wednesday 15 May 2013

javascript - jQuery selector for next div by class in a table cell -


I have tried many things but no one is working.

What am I trying to do? A database which stores the serial number for all the stocks I get, I can get the basic tasks to work.

I have a javascript function within HTML that adds additional serial number fields according to the quote input.

My only problem is that when I add another product field to the table and change its quota field, it adds additional fields to all serial numbers cells.

I only need

  $ ("serial"). ("And lieutenant") helps find the right selector for the next div. ; Input type = 'text' name = 'serial []' id = 'serial-number' /> & Lt; Br / & gt; ");    

The issue is that you are looking for all the elements with the specified class And are adding everyone

looking for you:

  $ (". Serial"). Last ()   

Alternatively you can

  $ (".serial"). Eq (INDEX)   

Later on you only have the basis of a serial box Index should be able to attach to.

It seems that by parsing the dom tree of HTML elements Paco is some need to select HTML elements that you need. Please see changes made to your jsfiddle:



No comments:

Post a Comment