Javascript: Prevent browser to display input history for a field on press of down key

Is there anyway to prevent the browser from displaying previously inputted values for a field on press of the down key?

If this is not possible, another problem of mine is on press of the down key, the list of previously inputted values will be shown and on press of the TAB key, the currently highlighted value on the list will be chosen and will be set as the value of the field. I do not want this, I just want the focus to be passed to the next input element w/o choosing any values.

Are there any ways to override the browser behavior? A solution in play javascript is preferred though jQuery solutions are fine as well. Thanks!

Just add the autocomplete attribute

<input type="text" autocomplete="off" />

You can disable autocomplete by adding autocomplete="off" onto your input tags. MDN Reference


<input type="text" name="email" value="" autocomplete="off" />

See this Stack Overflow post for browser compatibility.

html code

<input type="text" autocomplete="off" id="password-field" class="form-control"  name="multi_user_pin" placeholder="Type your PIN here"/>
jquery code
$('#password-field').on('input keydown',function(e) { 
            if(e.keyCode == 8 && $(this).val().length==1) {
                $(this).attr('type', 'text');
                if ($(this).val() !== '') {
                    $(this).attr('type', 'password');
                } else {
                    $(this).attr('type', 'text');


This code works fine for password field to prevent to remember its history with all browsers

The answers/resolutions are collected from stackoverflow, are licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0 .
Read More:   Is parsing JSON faster than parsing XML

Similar Posts