jquery - Get the value form a another input field -


this input field on fourth place:

<td><input type="number" name="tour" value="12" size="2" maxlength="2"></td> 

this js dosnt work:

var htour = $(this).parents('tr').find('td:nth-child(4)').val(); 

whats wrong?

your javascript getting value of td element. want input element's value:

var htour = $(this).closest('tr').find('td:nth-child(3) input').val(); 

:nth-child() zero-indexed, :nth-child(0) first element, :nth-child(1) second, , on.


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -