i have a dropdown list and want to set the default option by its text(not value), the drop down list is:
<select class="size">
<option value="0">size0</option>
<option value="1">size1</option>
<option value="2">size2</option>
</select>
i want to set the default value to size1, and i tried the following code but none of them works:
$(@el).find('.size>option').filter(=>$(this).text() == 'size1').prop('selected', true)
$(@el).find('.size>option[text="size1"]').attr('selected', true)
$(@el).find('.dimension_post option[text="size1"]').attr('selected', true)
thanks
<option>s --$(@el).find('.size>option')?