jquery: select element based on name and ancestor
<p>I want to attach a click event to elements that are named "page_chooser", but only if they have an ancestor with id = "posting".</p>

<p>To just get elements named "page_chooser" I do this:</p>

<pre><code>$("[name=page_chooser]").click(function() {
</code></pre>

<p>How can I add the extra ancestor restriction? I want to do this because I use the name "page_chooser" on several webpages, but the click function should be different. </p>
