Clears the default content of the text box when activated

Updated on technology 2024-02-09
12 answers
  1. Anonymous users2024-02-05

    Set the onfocus of the text box and clear the contents.

  2. Anonymous users2024-02-04

    Does it become the default after it is cleared? What I'm trying to say is, did you submit a request for that button click event? If not, then the situation you are talking about is not possible. I wrote a small example, you see:

  3. Anonymous users2024-02-03

    I don't know if it works by calling the reset() method.

  4. Anonymous users2024-02-02

    Set an onclick method to the text box.

    function click()

  5. Anonymous users2024-02-01

    Default value'}" onfocus="if('I'm the default')"/>

    Copy the ** above into the html file yourself. Try it. If you don't meet the requirements, adjust it yourself.

  6. Anonymous users2024-01-31

    function issupportplaceholder ()if(!issupportplaceholder())= function ()

    The placeholder attribute is provided in HTML5 to do this, so we can first consider using the method provided by the browser.

    If this property is not supported, then use js to implement it.

  7. Anonymous users2024-01-30

    You can use the onfocus and onblur events of the text box to determine whether the text box is empty or not, and if it is empty, it is the default text.

  8. Anonymous users2024-01-29

    After submitting the form, the text box is not empty.

    1. Use the form to submit, add the data of the text box to the script and then return to refill the text box.

    2. Use ajax

    The content in the text box for the next login will remain the same.

    Save to a database (or a text file, which has to be saved somewhere on the server anyway) the first time you enter something

    The next time you log in, insert the data and repopulate the text box.

  9. Anonymous users2024-01-28

    After logging in, filling out the form, and submitting it.

    Write information to a database or hard disk.

    The next time you log in, you can read a database or hard drive file and display the data into a form.

  10. Anonymous users2024-01-27

    This has to be stored in a database to store the input data......

  11. Anonymous users2024-01-26

    It's best to set the original value to a hidden field when you enter the page, and read it every time you commit an input failure. This hidden field can be placed under your input box. For example:

  12. Anonymous users2024-01-25

    Wouldn't it be okay to give him a null value directly?

Related questions