Using this: clip.addEventListener( 'onMouseDown', my_mouse_down_handler ); function my_mouse_down_handler(client) { alert( "mouse button is down" ); } Code (markup): How can integrate this jQuery function so that the quick-alert div is displayed instead of alert( "mouse button is down" );? $(document).ready(function() { $('#show-alert').click(function() { $('<div class="quick-alert">Alert Message</div>') .insertAfter($(this)) .fadeIn('slow') .animate({opacity: 1.0}, 3000) .fadeOut('slow', function() { $(this).remove(); }); }); }); Code (markup):