Wednesday, November 3, 2010

Setting select option index in jQuery

$('#myselect option:eq(1)').attr('selected', 'selected');

This will select the first option

1 comment:

  1. No, this will select the second option,
    eq(0) wil select the first option.

    ReplyDelete