making the assumption that you have a button like this:
<input type="button" class="mybuttons" value="Click Me"/>
and some css for example:
.openerclass { background-color: red; }
add this class when clicked
$(function() { var myevent; $(".mybuttons").click(function(event){ myevent = $(event.target); $(".selector").dialog("open"); }); $(".selector" ).dialog({ open: function(event, ui) { var opener = $(event.target); myevent.addClass("openerclass"); alert(myevent.nodeName); ... } }); });
Edit: correct syntax error and add another example to clear it
Edit2: the original was wrong (sort of) in that the openener event is NOT associated with the click event. Modified to properly use the click event.
source share