• Advanced usage of web form element input 11 examples


    1. Dashed box when the Cancel button is pressed Add the attribute value hidefocus or hidefocus = true in input2. Read only text box content Add the attribute value readonly in input3. Prevent the text document from being back emptied (the style content can be used as a class reference) <INPUT style=behavior:url(#default#savehistory); type=text id=oPersistInput> 4. […]

  • The difference between name and value in the input tag


    Type browser controls for access (for example, type = “text”, which is a text box; type = “button”, which is a button)The optional values of type are as follows:Button buttonCheckbox check button componentFile upload componentHidden hidden domainImage picture areaPassword password input text boxRadio button componentReset reset form buttonSubmit submit form buttonTexttext input box*********************************************************************** ID is […]

  • How to use input event to monitor the input of mobile terminal


    Today, there is a new requirement. The manager requires the comment function to limit the number of words, just like microblog, which limits the maximum number of words to 150. Here we need to remind users how many words they can input in real time. At the beginning, I thought of listening to the Keyup […]

  • The method of making text box such as form input read-only and non editable in HTML


    Sometimes, we want the text box in the form to be read-only, so that users can’t modify the information in it. For example, the word “China” can’t be modified for the content of < input type = “text” name = “input1” value = “China” >. There are several ways to achieve it. Method 1: onfocus […]

  • Input file custom button beautification (Demo)


    I have written such an article before, but I used JS script. The advantage is that I can display the file path. If you don’t need to see the path, you can only display the custom button. There is another method. The following is just using the CSS technique. The key is to give font […]

  • The difference between button and input type = button


    < button > label Definition and Usage The < button > tag defines a button.Inside the button element, you can place content, such as text or images. This is the difference between this element and the button created with the input element.The < button > control provides more powerful functions and richer contents than the […]

  • The difference between html4 and HTML5 is how to add focus implementation code to an input


    html4: Copy code The code is as follows: <form> <p><label>Username:<input name=search type=”text”></label></p> <script type=”text/javascript”> document.getElementById (‘search’).focus() </script> </form> html5: Copy code The code is as follows: <form> <p> <label>Search:<input name=search autofocus></label> </p> </form>

  • Remove the white background and border of input box on HTML5 page of mobile terminal (compatible with Android and IOS)


    Two days ago, in the HTML5 page developed on wechat, there was an order query to select the time. The input type = “date” > input box, which was just used, didn’t add any style. The effect was that the white background and the border were ugly, which was completely incompatible with the whole background. […]

  • The input text box is not allowed to enter implementation properties


    Today, I would like to summarize several useful HTML tags, which are often used in development. Those who are not familiar with them may not be very clear Copy code The code is as follows: readonly、disabled、autocomplete Readonly means that the value of this field can’t be modified. It can only be used with type = […]

  • Using input type = text value = STR to value incomplete solution


    Today, I encountered a very strange problem. Take a look at the following code:SimpleDateFormat dateFormat = new SimpleDa Copy code The code is as follows: Teformat (“yyyy MM DD e”);String date = dateFormat.format(new Date()); The original intention is to print out XX, XX, XX, XX, XX, XXThe problem lies in the following code. When I […]

  • What is the meaning of input type and how to limit input


    Common methods of limiting input1. Cancel the dotted box when the button is pressed, and add the attribute value hidefocus or hidefocus = true in input Copy code The code is as follows: < input type = submit “value = submit” hideocus = true / > 2. Read only text box content, add attribute value […]

  • Example code of CSS pseudo class modifying input selected style


    Note: this table is from w3school tutorial The classification and function of pseudo elements are as follows Let’s take a look at the example code of CSS pseudo class modifying the selected style of input. The code is as follows: Mainly used after pseudo class and font symbols. input{ -webkit-appearance: none; -moz-appearance: none; appearance: none; […]