Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
This paste will be private.
jQuery("#peopleTable").click(function (event) { var target = jQuery(event.target); if (target.is("input.getName")) { if (target.is("input.also")) { var name = target.parent().prev().text() || "unknown"; var id = target.parent().parent().attr(id).replace("Person-", ""); alert(id + " : " + name); } } }) //////////////// <table id="peopleTable"> <tr id="Person-12"><td class="name">person's name</td><td><input type="button" class="getName also"></td></tr> </table>
From the Design Piracy series on my blog: