一定专区内的JQuery元素,但结尾 [英] JQuery element within a certain div but ending with

查看:101
本文介绍了一定专区内的JQuery元素,但结尾的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 < D​​IV ID =A>
    <选择一个id =ctl100_placeholder1_ctl201_d preasons>< /选择>< / DIV>&所述;格ID =B>
     <选择一个id =ctl100_placeholder2_ctl202_d preasons>< /选择>
< / DIV>
< D​​IV ID =C>
     <选择一个id =ctl100_placeholder3_ctl203_d preasons>< /选择>
< / DIV>

我使用asp.net的DropDownList其中如上使我可以得到结束下拉列表中举行
  $([ID $ = _丁preasons])但我怎么用DIV ID =A或B或C<得到它/ p>

解决方案

以A $(#一[ID $ = _丁preasons])结果
与B $(#B〔ID $ = _丁preasons])结果
以C $(#C [ID $ = _丁preasons])

<div id="a">
    <select id="ctl100_placeholder1_ctl201_dpReasons"></select>

</div>

<div id="b">
     <select id="ctl100_placeholder2_ctl202_dpReasons"></select>
</div>
<div id="c">
     <select id="ctl100_placeholder3_ctl203_dpReasons"></select>
</div>

I am using asp.net dropdownlist which renders as above and I can get hold of the dropdown list ending with $("[id$=_dpReasons]") but how do I get it with div id ="a" or "b" or "c"

解决方案

with "a" $("#a [id$=_dpReasons]")
with "b" $("#b [id$=_dpReasons]")
with "c" $("#c [id$=_dpReasons]")

这篇关于一定专区内的JQuery元素,但结尾的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆