Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How to add type property color Color Picker to input in HTML5

Shulou Source: shulou.com Published: 2022-05-31 13:13:52 10月04日 Update

In this article Xiaobian for you to introduce in detail "input in HTML5 how to add type attributes color color picker", detailed content, clear steps, details handled properly, I hope that this article "input in HTML5 how to add type attributes color color picker" article can help you solve doubts, following the editor's ideas slowly in-depth, together to learn new knowledge bar.

Definition and usage

The type attribute specifies the type of input element.

Note: this property is not required, but we think you should always use it.

Color picker document.querySelector ("# color"). Onchange = function () {document.getElementById ('color'). Click (); / / the click event must be added or the color change document.body.style.background = this.value;} cannot be triggered by clicking the OK button.

Let's take a look at the HTML 5 type property

Attribute value

The value describes the button definition clickable buttons (mostly used with JavaScript to start the script) the checkbox definition check box. Color defines the color picker. Date definition date field (with calendar control) datetime definition date field (with calendar and time controls) datetime-local definition date field (with calendar and time controls) month definition date field month (with calendar control) week definition date field week (with calendar control) time definition date field hours, minutes, seconds (with time control) email definition text field for e-mail address file definition input field and "browse." Button for file upload hidden definition hidden input field image definition image as submit button number definition numeric field with spinner control password definition password field. The characters in the field are obscured. Radio defines radio buttons. Range defines a numeric field with a slider control. Reset defines the reset button. The reset button resets all form fields to their original values. Search defines the text field used for the search. Submit defines the submit button. The submit button sends data to the server. Tel defines the text field used for phone numbers. Text defaults. Defines a single-line input field in which the user can enter text. The default is 20 characters. Url defines the text field used for URL. Read here, this "HTML5 input how to add type attributes color color picker" article has been introduced, want to master the knowledge of this article also need to practice and use in order to understand, if you want to know more about the article, welcome to pay attention to the industry information channel.

Tags: Fields buttons controls properties date text color input article content characters numbers propriety events elements available in number image address password Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno NVidia Linux vpn macOS Shulou Technology