jQuery to enable and disable textbox with button on click

前端 未结 1 1507
迷失自我
迷失自我 2021-01-17 08:57

When I click the button the first time, I would like textbox1 to be enabled, but textbox2 and textbox3 disabled, then when I click the button for the second time, textbox2 i

相关标签:
1条回答
  • 2021-01-17 09:52

    Say like bellow

    var count = 0;
    
    $('#btn').click(function(){
        count = count%3;
        $('input[type="text"').attr('disabled',true).eq(count++).attr('disabled',false);
    })
    

    On fourth click it will again enable first input.

    DEMO

    0 讨论(0)
提交回复
热议问题