I am using FuncUnit with qunit to test an application. I would like to set selected
property of an option of <select>
menu to be true
.
In jQuery
, I could do something like
$('select#id option:eq(0)').prop('selected', true).change();
to achieve this. But, in funcunit,
S('select#id option:eq(0)').prop('selected', true).trigger('change');
selector finds the element and just get (not set) the value of prop selected
. I want to set prop of the element.
As per comment from funcunit team - A user wouldn't be able to set the property of an option, they would just know to perform some action such as a click, drag, etc.
so to achieve this we need to do
This runs jquery on test window.