You can also use the latter method. Something like that:
$("#myID").last();
But make sure you have jquery 1.4.X. If : the latter matches only one element,: the last-child can match more than one: one for each parent.
and I think that what you write will work this way.
$("#myID input:last-child").val();
source
share