Alert text of span tag inside div with jQuery Droppable -
js fiddle can found here. have 2 sets of divs, ones can draggable
, droppable
. i'm trying add text inside of span element on array element caused drop event fired cannot cause second drop fired (not pertinent @ moment because doesn't work either).
why isn't alert($(this).find("span").text());
finding alerting text of span tag inside element dragged?
html
<div id="quizcontainer"> <div id="questionscontainer"> <div class="drugquizzes"> <span>docusil</span> </div><div class="drugquizzes"> <span>oracea</span> </div><div class="drugquizzes"> <span>zyloprim</span> </div> </div> <div id="answerscontainer"> </div> <div class="druganswers" style="background-color:palevioletred;"> </div><div class="druganswers" style="background-color:palevioletred;"> </div><div class="druganswers" style="background-color:darkkhaki;"> </div>
to text of dropped element, change:
alert($(this).find("span").text());
to
alert(ui.draggable.find('span').text());
Comments
Post a Comment