How can you find out what is contained within each Div? Using the following code:
<div id="inventory" ondrop="drop(event)" ondragover="allowDrop(event)"></div>
<div id="chest" ondrop="drop(event)" ondragover="allowDrop(event)"></div>
<span id="sword" draggable="true" ondragstart="drag(event)">Sword </span>
<span id="shield" draggable="true" ondragstart="drag(event)">Sheild </span>
And this in Story Javascript:
Window.allowDrop = function (ev){
ev.preventDefault();
}
Window.drag = function (ev) {
ev.dataTransfer.setData("text", ev.target.id);
}
Window.drop = function (ev){
ev.preventDefault();
var data = ev.dataTransfer.getData("text");
ev.target.appendChild(document.getElementById(data));
}
And this in Story CSS:
#inventory {
width: 350px;
height: 70px;
padding: 10px;
border: 1px solid #aaaaaa;
}
#chest {
width: 128px;
height: 256px;
padding: 10px;
border: 1px solid #aaaaaa;
}
How do I find out the contents of each Div? Is it something like this:
<<print #inventory>>
<<if #sword in #inventory>>do something<</if>>