How to Disable or Turn on/off HTML5 Form Fields Autocomplete Suggestions in Browser

Here, You are going to study the article with the topic of How to Disable or Turn on/off HTML5 Form Fields Autocomplete Suggestions in Browser. Let’s jump on to the article directly.

How to Disable or Turn on/off HTML5 Form Fields Autocomplete Suggestions in Browser

How to Disable or Turn on/off HTML5 Form Fields Autocomplete Suggestions in Browser

In order to get started, you need to make an index.html file and copy-paste the following code

index.html

<!DOCTYPE html>
<html>

<head>
    <title>Autocmplete on/off</title>

    <style>
        h1 {
            color: green;
        }
    </style>
</head>

<body style="text-align:center;">
    
    <h1 style="color:green;">
        GeeksforGeeks
    </h1>
    
    <h4>Autocmplete on/off</h4>
    
    <form action="https://ide.geeksforgeeks.org/tryit.php"
                    autocomplete="on">
        First name: <input type="text" name="fname">
        
        <br><br>
        
        Last name: <input type="text" name="lname">
        
        <br><br>
        
        Email_id: <input type="email" name="email"
                    autocomplete="off">
        
        <br><br>
        
        <input type="submit">
    </form>
    
    <p>
        <b>Note:</b> autocomplete is "on" for the
        form, but "off" for the e-mail field.
    </p>
</body>

</html>

In the above code, we are using the special html5 form attribute called autocomplete to turn on/off autocomplete suggestions inside the form input fields

Final Thoughts

We hope this article How to Disable or Turn on/off HTML5 Form Fields Autocomplete Suggestions in Browser will be helpful to you. Do share this study with other CSS and HTML developers via social media. If you have any doubts regarding this article? then let me know via the comment section.

Share on:

Hi, I'm Ranjith a full-time Blogger, YouTuber, Affiliate Marketer, & founder of Coding Diksha. Here, I post about programming to help developers.

Leave a Comment