У меня есть раскрывающийся список, который имеет много вариантов. Я хочу, чтобы при выборе любого , то он вызывает функцию через JavaScript.
код, который я использовал здесь
<select name="aa" onchange="report(this.value)"> <--- this is function in .js
<option value="daily">daily</option>
<option value="monthly">monthly</option>
</select>
Я хочу, когда я выбираю ежедневно, тогда срабатывает функция (ежедневно) и наоборот.
function report(daily)<-- js function {
loadXMLDoc('script/d_report.php','responseTag');
document.getElementById('responseTag').style.visibility='visible';
document.getElementById('list_report').style.visibility='hidden';
document.getElementById('formTag').style.visibility='hidden';
}
function report(monthly) {
document.getElementById('responseTag').style.visibility='visible';
loadXMLDoc('script/m_report.php','responseTag');
document.getElementById('list_report').style.visibility='hidden';
document.getElementById('formTag').style.visibility='hidden';
}