I would like selected after append template the first input (class is time).
How to do this?
$.get('@Url.Action("Bonus")', function (template) {
$("#bonuses").append(template);
// I would like focused first input in template $(template).first().focus();
});
html in template:
<input autocomplete="off" name="BonusList.Bonuses.Index" type="hidden" value="3c6f7b63-cc96-4971-a5b5-2e4640ca97e5" />
<input class="time" id="BonusList_Bonuses_3c6f7b63-cc96-4971-a5b5-2e4640ca97e5__ID" name="BonusList.Bonuses[3c6f7b63-cc96-4971-a5b5-2e4640ca97e5].ID" type="hidden" value="0" />
3c6f7b63-cc96-4971-a5b5-2e4640ca97e5 - is random GUID
it's important #bonuses have many input befor this append