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. }); 

updated fiddle


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -