我有最初是被禁用的輸入的文本框。啓用輸入文本框然後其聚焦 - jQuery Mobile的
<input type="text" name="count" id="count" value="0" disabled="true" data-theme="b" />
當我檢查單選按鈕,我想啓用和集中的文本框,但是當我點擊單選按鈕,它可以使文本和重點的一些其他文本框。我認爲它不起作用,因爲文本框最初是禁用的,並且您無法關注禁用的輸入。
$(":input[@name='radio']").live('change', function() {
$(":input[@name='count']").removeAttr("disabled").focus();
});
如何啓用文本框然後將其關注?
$。( 「:輸入[@名稱= '計數']」)removeAttr( 「無效」); $( 「:輸入[@名稱= '計數']」)聚焦(); – 2012-02-28 12:26:56
首先刪除禁用的attr而不是關注它。像$(「:input [@ name ='count']」)。removeAttr(「disabled」) $(「:input [@ name ='radio']」)。focus(); – 2012-02-28 12:29:17
都能跟得上...這是行不通的...... – 2012-02-28 17:37:56