Disable autocomplete for all jquery datepicker inputs

前端 未结 5 1732
余生分开走
余生分开走 2020-12-03 10:42

I want to disable autocomplete for all inputs using jquery ui datepicker without doing this to every input manually. How could be this done?

5条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-03 11:01

    try this:

    $('.datepicker').on('click', function(e) {
       e.preventDefault();
       $(this).attr("autocomplete", "off");  
    });
    

    in anycase you have not mentioned in your question that this is coming from an ajax call!

提交回复
热议问题