我正在使用FuncUnit和qunit来测试应用程序。我想设置selected
<select>
菜单的选项属性为true
。如何在qunit窗口(测试窗口)中使用Funcunit设置元素的属性
在jQuery
,我可以做类似
$('select#id option:eq(0)').prop('selected', true).change();
实现这一目标。但是,在funcunit,
S('select#id option:eq(0)').prop('selected', true).trigger('change');
选择找到元素和刚刚获得(未设置)道具selected
的价值。我想设置元素的道具。
是啊,我已经尝试了attr()和click(),dint的工作。我正在使用'change'来手动触发事件。 – NageN