I have an instruction below that checks if any of the Divs with id #Drop are empty, if one of them is empty, it shows a warning. however, at present, when any div has content inside it, the statement no longer works.
I suppose I'm trying to say that I want it to appear if the ANY div is empty. There are 4 Divs in total, and if any of them is empty, a warning message should appear, it does not matter if, for example, 3 of 4 contents, a warning should appear whenever there is an empty div.
HTML:
<div id="Drop1" ondrop="drop(event)" ondragover="allowDrop(event)"></div> <div id="Drop2" ondrop="drop(event)" ondragover="allowDrop(event)"></div> <div id="Drop3" ondrop="drop(event)" ondragover="allowDrop(event)"></div> <div id="Drop4" ondrop="drop(event)" ondragover="allowDrop(event)"></div>
JS:
$("#run").click(function(){ if ($("[id^='Drop']").html() === ""){ alert("empty")
source share