我目前已經有了一個腳本來檢查選擇框的值,然後在它旁邊啓用一個文本字段,然後有望設置焦點。將焦點設置爲jQuery中的下一個輸入?
我有這個處是使輸入字段正常工作的那一刻...
$("#assessed select").change(function() {
if($(this).val() == 'null') { $(this).next('input').attr("disabled", true); }
else { $(this).next('input').removeAttr("disabled"); }
});
我有點憋屈「專注」位是誠實的,我試過「$(本)的.next( '輸入')聚焦();」。但這並沒有關注所有,雖然它沒有提出一個JavaScript錯誤要麼...
$("#assessed select").change(function() {
if($(this).val() == 'null') { $(this).next('input').attr("disabled", true); $(this).next('input').focus(); }
else { $(this).next('input').removeAttr("disabled"); }
});
任何想法,請大家?我非常堅持這一點,這將是一個非常簡單但對我正在構建的頁面非常有用的補充!
感謝
你能張貼您的HTML呢? – RaYell 2009-08-05 10:35:19