【发布时间】:2009-10-29 06:43:10
【问题描述】:
给定以下 html:
<tr>
<td>Content</td>
<td>Content</td>
<td>Content</td>
<td><img id="imgProductPurchased" runat="server" visible="true" alt="Product Purchased" title="Product Purchased" src="/sitecore/shell/Themes/Standard/Applications/16x16/checkbox.png" /></td>
<td>
<asp:PlaceHolder ID="plhPurchased" runat="server">
<span class="roundButton roundButtonLarge"><a id="hypPurchased" class="registryPurchased" href="#" title="Mark product as purchased" runat="server"><span>
<em class="registryPurchased"></em>Purchased</span></a> <span class="buttonEndLarge">
</span></span>
</asp:PlaceHolder>
</td>
</tr>
<tr>
Repeats above
</tr>
我在“hypPurchased”上有一个点击事件。当该事件触发时,我需要访问该行的 plhPurchased 元素和“imgProductPurchased”元素。
编辑:
我应该说这是使用 ASP.NET 构建的,因此,id 都是唯一的。
【问题讨论】:
-
鉴于它是一个 ASP.NET 占位符,在呈现的 HTML 中是否存在 ID 为
plhPurchased的元素?当您在浏览器中查看源代码时,这是什么样的?
标签: javascript jquery jquery-selectors