jquery fire a click anywhere within a dialog box -
i have dialog window, 2 2 table. instead of clicking on button, want able click on cell , returns value/text in alert box. unsure place following alert($(event.target).text());
?
$("#dialog-message").dialog({ modal: true, draggable: false, resizable: false, position: ['center', 'top'], show: 'blind', hide: 'blind', width: 400, dialogclass: 'ui-dialog-osx', buttons: { "i've read , understand this": function() { $(this).dialog("close"); } } });
here code fiddle
bind click event th,td
(according markup) if need cell text.
$("#dialog-message th,td").click(function(event){ alert($(event.target).text()); //$(this).text() work too. });
Comments
Post a Comment