var parent = $(this).parent().parent().parent().parent().next().attr("id");
alert ($("#"+parent).child开发者_如何学Goren(".select_tarif").get());
I try to retrieve elements, with parent and class (I can't use only the class, because I have other elements with same class, but variant parent).
The way to retrieve the parent is ugly, but I can't do otherwise (html is generated) and it return what I want.
My problem is, function alert() returns nothing, but it will display element is a select input
Use:
$("#"+parent).find(".select_tarif")
You don't need to use another selector (and find is better)
var parent = $(this).parent().parent().parent().parent().next();
alert (parent.find(".select_tarif").get());
精彩评论