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), row = target.parent("tr[id^=Person]"); if (target.is("input.getName.also")) { var name = row.find("td.name").text() || "unknown"; var id = row.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: