[英]Selecting sharepoint elements with jquery
我有兩個單選框,但在將它們設置為只讀時遇到了麻煩,因此我決定禁用一個未選中的選項。 我嘗試使用jquery以及從控制台從單選框獲得的信息來“獲取”元素。 但是,它沒有用。 我從來沒有真正寫過Jquery,所以我很難找到錯誤。
//priority - disable unchecked radiobox
var high = $("input[value='ct101']");
var reg = $("input[value='ct100']");
if(reg.checked == true){
high.disabled=true;
}else{
reg.disabled=true;
}
普通收音機
<input id="ctl00_m_g_0537f4e9_69aa_409a_b5ed_15e3624efeab_ctl00_ctl05_ctl02_ctl00_ctl00_ctl04_ctl00_ctl00"
type="radio"
value="ctl00"
disabled="true"
name="ctl00$m$g_0537f4e9_69aa_409a_b5ed_15e3624efeab$ctl00$ctl05$ctl02$ctl00$ctl00$ctl04$ctl00$RadioButtons"
>
高收音機箱
<input id="ctl00_m_g_0537f4e9_69aa_409a_b5ed_15e3624efeab_ctl00_ctl05_ctl02_ctl00_ctl00_ctl04_ctl00_ctl01"
type="radio"
name="ctl00$m$g_0537f4e9_69aa_409a_b5ed_15e3624efeab$ctl00$ctl05$ctl02$ctl00$ctl00$ctl04$ctl00$RadioButtons"
value="ctl01"
checked="checked"
>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.