Is there any way I can run a script when I have a combobox open?
Is there any way I can run a script when I have a combobox open?
The click
event you can implement as follows:
document.getElementById("combobox").addEventListener("click", eventoClick);
function eventoClick() {
alert("teste do onclick")
}
There is also the change
event that is when you switch the combobox options:
document.getElementById("combobox").addEventListener("change", eventoClick);
function eventoChange(){
alert("teste do change")
}
And also mouseover
:
document.getElementById("combobox").addEventListener("mouseover", eventoMouseOver);
function eventoMouseOver() {
alert("teste do mouseover")
}
Follow the jsfiddle