【发布时间】:2012-05-17 18:13:01
【问题描述】:
假设我在一个 aspx 页面上有这个 HTML 标记:
<div id = 'logo-container' class='foo'>
<img alt='logo' src ="images/foo.png" />
</div>
纯 html,不是 runat=server。
是否有可能,在 aspx 代码隐藏中,使用 CSS 选择器来引用 DOM 元素?您能否参考 IMG 执行以下操作:
foreach element in GetElement("#logo-container img")
{
do something with element, e.g. change a style attribute
}
【问题讨论】:
标签: asp.net css-selectors code-behind