The difference between 2014/4/18①button and submit ② phenomenon: The other values in the database can be taken but not resolved to see if "#" there is no

Source: Internet
Author: User

①<input type= "button"/> This is a button . If you don't write JavaScript , you can't press anything .
occur .

<input type= "Submit"/> Such a button the user will automatically submit the formwhen clicked , unless you write a JavaScript blocking
Stop it.

<button> This button in the form will also click Auto-commit , the advantage of the top two is that the content of the button can not only have the text
words, and can have pictures and other multimedia content . (Of course, the first two can be done with a picture background). Its disadvantage is that different bangs
The value of the browser, there may be other compatibility issues.
Other tags, such as A, IMG,
span, Div, and then use the picture to disguise it as a button.

② actually <input type= "Submit"/> is not a picture element , but is a form element , and the text input is
is part of the "data" (characterized by the Value property, and the values of that property are passed to the server
end, which can be used ), rather than part of the style. This kind of performance and data confusion design , is the early Web standard also relatively simple
Legacy of the time of the burrow.
From the perspective of the picture, the two can be depicted exactly the same through CSS.
Viewed from the screen action, through
JS can force both actions to be consistent (neither commit nor commit).
But only the form data is a feature that cannot be confused.
。 <button> can't think of itself as a form data .
So, if it's just a simple button that triggers some screen action, please make
Use <button>; instead, the screen data will be submitted to the server, generally with <input type= "Submit"/>
<button>+js can also be completely replaced.

The difference between 2014/4/18①button and submit ② phenomenon: The other values in the database can be taken but not resolved to see if "#" there is no

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.