Site icon Hip-Hop Website Design and Development

How to Disable Browser Autocomplete on a form? [migrated]

In this example (Location Field) when the user starts typing “London” it will show the drop down from the form itself. On top of it, it will also show the Autocomplete from the browser.. which makes impossible for the user to select the options from the form…

How can I stop that?

check screenshots: https://imgur.com/a/gGKgTZe and https://imgur.com/5OTvHKk

I used the code below but it didn’t work

jQuery(document).ready(function($) {
    var $list = [
        'job_email',
        'job_phone',
        'job_title',
        'job_location'
    ];
     $.each( $list, function( index, $value ) {
        if ( $('#'+ $value).length ) {
            $('#'+ $value).attr('autocomplete', 'new-password');
        }
    } );
});