[英]Get an input element with specific value in IE8?
我需要选择一个id
值并不总是相同的项(取决于ASP.NET WebForms的Code Behind设置的单选按钮的数量)。 唯一的是属于输入字段的值。
<input id="ctl00_ContentPlaceHolder1_RadioButtonList_2" type="radio"
name="ctl00$ContentPlaceHolder1$RadioButtonList" value="21" />
如何使用可在IE8中使用的JavaScript获取此输入元素?
对的,这是可能的。 您可以按照以下方式进行:
$(function(){
element = $('input[value="The unique value"]');
/*do whatever you want with this element*/
});
遵循此答案以获取更多信息: jQuery按文本查找元素
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.