我有这样的代码:为什么我的选择onchange不起作用?
<select>
<option onChange="filterProducts(this);">Select ...</option>
<option onChange="filterProducts(this);">Samsung</option>
<option onChange="filterProducts(this);">LG</option>
<option onChange="filterProducts(this);">Sony</option>
<option onChange="filterProducts(this);">Philips</option>
</select>
这应该解雇一个js方法,但它只是不火:
function filterProducts(firedByControl){
alert(fired);
}
对于这个按钮,调用同一个JS方法,所有的工作很好:
<button type="button" class="btn" onclick="filterProducts(this)" value="LCD">LCD</button>
你能告诉我我错了吗?
的平变化必须在''
感谢所有,令人难以置信的多么容易... –