How can I use jQuery to make an input readonly?

后端 未结 13 2160
挽巷
挽巷 2020-12-07 09:54

I have the following input:

  

How c

13条回答
  •  独厮守ぢ
    2020-12-07 10:27

    Given -

    
    

    this works - (jquery 1.7.1)

    $('input[name="foo"]').prop('readonly', true);
    

    tested with readonly and readOnly - both worked.

提交回复
热议问题