0
我有一个下拉列表,我使用onchange方法做了一些功能操作。如何将Dropdown onchange事件转换为列表onclick事件
bu其他一些页面我想在列表视图中使用相同的功能,但我不想复制我的脚本列表查看任何其他可能性。
<select id="filerProduct" name="filerProduct" onchange="filerProductBySearch(this);">
<option value="aa" id="aa">AA</option>
<option value="bb" id="bb">BB</option>
</select>
转换下拉以下面列出
列表查看:
<ul id="filerProduct" name="filerProduct">
<li value="aa" id="aa" onclick="filerProductBySearch(this);">AA</li>
<li value="bb" id="bb" onclick="filerProductBySearch(this);">BB</li>
</ul>
脚本下拉平变化:
function filerProductBySearch(event)
{
$('#filerProduct').val(event.value);
}
我想用同样的功能归档列表onclick