Demo of setting and getting hoverClass of droppable element

Drag me to my destination

Dropp here

change the option below to add new class.



HTML

<div class='row'> <div class='col-md-6'> 
<div id="draggable" class="ui-widget-content">
  <p>Drag me to my destination</p>
</div>
</div><div class='col-md-2'>  
<div id="droppable" class="ui-widget-content" >
  <p>Dropp here</p>
</div>
</div></div>
change the option below to add new class.

<div id=d1></div>
<br>

<div class='radio-inline'>
  <label><input type='radio' name='r1' id='r2' value='ui-state-highlight' >ui-state-highlight</label>
</div>

<div class='radio-inline'>
  <label><input type='radio' name='r1' id='r2' value='ui-state-error' >ui-state-error</label>
</div>
<div class='radio-inline'>
  <label><input type='radio' name='r1' id='r2' value='ui-state-error-text' >ui-state-error-text</label>
</div>
<div class='radio-inline'>
  <label><input type='radio' name='r1' id='r2' value='ui-state-disabled' >ui-state-disabled</label>
</div>
<div class='radio-inline'>
  <label><input type='radio' name='r1' id='r1' value='ui-state-active' checked>ui-state-active</label>
</div>

jquery

<script>
$(document).ready(function() {
////////////////
$( function() {
    $( "#draggable" ).draggable({
});
});
///////////
$( "#droppable" ).droppable({
hoverClass: "ui-state-active",

  drop: function( event, ui ) {
        $( this )
        .find( "p" )
        .html( "Welcome Dropped!" );
     }
    });
///////////////
var class_used = $( "#droppable" ).droppable( "option", "hoverClass" );
$('#d1').html( " <b>hoverClasses Used </b> " + class_used );
///////////
$("input:radio[name=r1]").click(function() {
var sel=$(this).val()
$( "#droppable" ).droppable( "option", "hoverClass", sel );
var class_used = $( "#droppable" ).droppable( "option", "hoverClass" );
$('#d1').html( " <b>hoverClasses Used </b> " + class_used );
})
///////////////////////
})</script>