Hello, I have created a drag and drop image where it can be drop either in a blue box or green box. But now I would like to display a text, for example, if the orange is in the blue box, when I click 'Next', a text will appear saying 'The orange is in a
blue box'. But I am not sure how to detect whether the orange is in the blue or green box when it is drop. Any suggestions is greatly appreciated, thank you.
head>
<style type="text/css">
#div1, #div2, #div3
{
float:left; width:200px; height:150px; margin:10px;padding:10px;border:1px solid #aaaaaa;
}
#div2
{
background-color:Blue;
}
#div3
{
background-color:Green;
}
</style>
<script>
function allowDrop(ev) {
ev.preventDefault();
}
function drag(ev) {
ev.dataTransfer.setData("Text", ev.target.id);
}
function drop(ev) {
ev. ...
Go to the complete details ...