I have the typical W3.CSS hover dropdown, but I want it disabled until ready:
<div id="A" class="w3-dropdown-hover" style="width: 100%;">
<button id="B" disabled class="w3-button" style="width: 100%;">Hover To Open</button>
<div id="C" class="w3-dropdown-content w3-bar-block w3-border" style="width: 100%;">
<p>2B</p>
<p>|| !2B</p>
</div>
</div>
As you can see I have put the disabled
on the button
and it looks disabled as you would expect.
But the dropdown still appears when I hover. I do not want that. I only want the dropdown to open when the button is not disabled.
You obviously cannot put the disabled
on C
, because the disabled
only works on things like button
s, input
s, etc.
Where do I put the disabled
?
When I am ready in my javascript, how do I remove/reapply the disabled
? By that I mean, on which of "A", "B" or "C" do I apply the jQuery $("#A_Letter").prop('disabled', false);
Edit: the only thing I can think of is put disabled
on the button and momentarily change the class of "A" to w3-dropdown-click
.