I am trying to disable a bunch of elements (divs that have onClick and other custom events) while a request is taking place.
I have tried with:
$("selector").children().prop("disabled", true);
Also with:
$("selector").children().attr("disabled", true);
Also with:
$("selector").children().attr("disabled", "disabled");
Neither of these worked, meaning that, they all kept their functionality even after disabled was applied to them.
To confirm that I am actually able to target all of the desired elements I tested with:
$("selector").children().css({backgroundColor: "black"});
All elements became black, so the targeting is correct.
I am open to any other suggestions on how to disable elements, basicly these are divs that should not be clickable (there are other events of interest, not just the click
), for the duration of a request, once a div is clicked, that is why I am trying to temporarily disable them, and re-enable them again, once I receive the response.