Prevent input having text by default

0

How do I prevent when opening a form, the inputs are empty and do not have text by default.

Basically what I want is for the inputs to be without any associated value. In this case the password is already there, but I wanted it to be always empty.

Andwhenwritingdonotpresentthelistofoptionswrittenpreviously.(asintheimagebelow)

    
asked by anonymous 08.09.2016 / 12:03

1 answer

3

Hello, have you used JQuery? see how easy it is to solve your problem with it.

<html>
    <head>
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script><script>$(function(){$('input').val('')})</script></head><body><form><inputtype="password" value="123" placeholder="digite sua senha"  autocomplete="off" />
            <input type="text" value="oie" placeholder="digite um texto"  autocomplete="off" />
        </form>
    </body>
</html>

In the example I used, every time you load / open the page the fields will be cleaned, you can adapt the code as you want.

The Placeholder = is to inform something in the field for the user to read

Autocomplete = is to activate or not the list of information already entered in the field I hope I have helped

    
08.09.2016 / 12:42