Tengo un menú desplegable que tiene muchas opciones. Quiero que cuando seleccione cualquier opción , llame a una función a través de JavaScript.cómo puede seleccionar desde el menú desplegable y llamar a la función javascript
el código que he utilizado aquí es
<select name="aa" onchange="report(this.value)"> <--- this is function in .js
<option value="daily">daily</option>
<option value="monthly">monthly</option>
</select>
quiero cuando selecciono al día, entonces la función (diario) se invoca y viceversa.
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';
}
, donde es su código? ¿Dónde están las funciones? –
su código en html – sadi
– sadi