javascript - jQuery next().val() undefined -
i try next input value after <td>
field. tried
$(this).parent("tr").next("input")
didn't work out.
here jsfiddle.
as can see need select option parse input ... want delimiter input value of same row ..
try el.parent("td").next().find("input[name=delimiter]").val()
:
$("#go").click(function () { $('.csv_field').each(function (index, element) { el = $(this); if (el.val() != "'-- none --'") { console.log(el.parent("td").next().find("input[name=delimiter]").val()); } }); })
you're iterating on .csv_field
select fields. parent td
want parent()
or parent("td")
parent("tr")
won't work because parent()
goes 1 level dom. want go next cell via next()
, child via find("input[name=delimiter]")
. note el.val() != "'-- none --'"
should el.val() != "-- none --"
Comments
Post a Comment