onclick event in disabled HTML element

I’m developing a SAPUI5 application. And in the page, the user has to select an item from select_A before he/she selects from select_B. Until he/she selects from select_A, the select_B box is disabled.

What I would like to have is: even when the select_B box is disabled, and the user tries to click it before selecting from select_A, the select_A box should become red.

I tried using onclick event, but, when the box is disabled, it doesn’t do anything.

Only as a test, I made this:

oSelectTamanho = new sap.m.Select();
oSelectTamanho.onclick = function() {
  console.log("click");
}

As I mentioned, it only outputs the "click" when the box is enabled, and I would need this when the box is disabled.

Do you have any idea how can I achieve this?

18 thoughts on “onclick event in disabled HTML element”

Leave a Comment