Comment: In HTML5, while adding and abolishing many elements, many attributes are also added and abolished, such as form-related attributes/link-related attributes, and some attributes in HTML4 are abolished. If you are interested, you can learn about it. It may be helpful for you to learn HTML5.
In HTML5, while many new elements are added and abolished, many attributes are also added and abolished.
New attributes
1. Form-related attributes
Specify the autofocus attributes for input (type=text), select, textarea and button. It allows elements to automatically gain focus when the screen is opened by specifying properties. Specify the placeholder attribute for input (type=text) and textarea, which will prompt the user's input to prompt the user for what they can enter. Specify form attributes for input, output, select, textarea, button and fieldset. It declares which form it belongs to and then places it anywhere on the page without losing it inside the form. Specify the required attribute for input (type=text) and textarea. This attribute means that the user will check when submitting, and there must be input content in the checking element. Add several new attributes to the input tag: autocomplete, min, max, multiple, pattern and step. There is also a list attribute that is used in conjunction with the datalist element; the datalist element is used in conjunction with the autocomplete attribute. The multiple attribute allows multiple files to be uploaded at once during upload; the pattern attribute is used to verify the pattern of the input field, which is actually a regular expression. The step attribute specifies the legal numerical interval of the input field (if step=3, the legal numerical should be -3, 0, 3, 6, and so on). The step attribute can be used in conjunction with the max and min attributes to create a range of legal values. Add format, formctype, formmethod, formnovalidate and formtarget properties to the input and button elements. The user overloads the action, enctype, method, novalidate and target attributes of the form element. Add disabled attribute to the fieldset element, and its child elements can be set to disabled state. Adding the novalidate attribute to input, button, and form can cancel the relevant checks performed during submission, and the form can be submitted unconditionally.2. Link related attributes
Add media attributes to a and area. Specifies why the target URL is optimized for the type of media/device. This attribute is used to specify that the target URL is designed for a special device (such as an iPhone), voice or printing medium. This property can accept multiple values. Only use when the href attribute exists. Add herflang and rel attributes to area. The hreflang property specifies the language of the text in the linked document. This property can only be used when the href property is set. Note: This attribute is purely consultative. The rel attribute specifies the relationship between the current document and the linked document/resource. The rel property can only be used when the href property is used. Adds the size attribute to the link. The sizes attribute specifies the size of the linked resource. This property can only be used when the linked resource is an icon (rel=icon). This property can accept multiple values. Values are separated by spaces. Adding target attribute to the base element is mainly to maintain consistency with the a element.3. Other attributes
Adds reversed attribute to ol, which specifies the list to be displayed in reverse order. Add the charset attribute to meta and add the type and label attributes to menu. label defines a courseware label for the menu, and the type attribute can be used in three forms: context menu, toolbar and list. Add scoped attribute to style. It allows us to define styles for specified parts of the document, rather than the entire document. If the scoped attribute is used, the specified style can only be applied to the parent and child elements of the style element. Add or delete attributes for script, which defines whether the script is executed asynchronously. The async attribute is only applicable to external scripts (only when using the src attribute). There are multiple ways to execute external scripts: If async=async: The script is executed asynchronously relative to the rest of the page (the script will be executed when the page continues to parse) If async is not used and defer=defer: The script will be executed when the page completes parsing. If neither async nor defer: Before the browser continues to parse the page, read and execute the script immediately add manifest to the html element. When developing offline web applications, it uses it in conjunction with the API to define a URL, which describes the cache information of the document on this URL. Add a sprcdoc attribute to the iframe, sandbox, seamless, srcdoc. Used to improve page security and prevent distrusted web pages from performing certain operations.Abolished attributes
Some properties in HTML4 are no longer used in HTML5, but are replaced by other properties or other methods.
A property used in HTML 4 Alternatives to use elements of that property in HTML 5
rev link, a rel
charset link, a Use HTTP Content-type header element in the linked resource
shape,coords a Use area element instead of a element
longdesc img, iframe link to principal description using a element
target link redundant attributes, omitted
nohref area redundant attributes, omitted
profile head redundant attributes, omitted
version html redundant attributes, omitted
name img id
scheme meta Use scheme only for a form field
archive, chlassid, codebose, codetype, declare, standby object Use data and typc attribute classes to call the plug-in. When you need to use these properties to set parameters, use the param attribute
valuetype, type param Use name and value attributes, and the MIME type is not declared.
axis, abbr td, th use the form of a clear and concise text, followed by a detailed text. You can use the title attribute for more detailed content to make the content of the cell shorter
scope td uses HTTP Content-type header element in linked resource
align caption, input, legend, div, h1, h2, h3, h4, h5, h6, p Use CSS stylesheets to replace
link, link, text, vlink, background, bgcolor body Use CSS stylesheets to replace
align, bgcolor, border, cellpadding, cellpacing, frame, rules, width table using CSS stylesheets instead
align, char, charoff, height, nowrap, valign tbody, head, tfoot Use CSS stylesheets to replace
align, bgcolor, char, charoff, height, nowrap, valign, width td, th use CSS stylesheet instead
align, bgcolor, char, charoff, valign tr use CSS stylesheet instead
align, char, charoff, valign, width col, colgroup use CSS stylesheet instead
align, border, hspace, vspace object Use CSS stylesheets to replace
clear br Use CSS stylesheets instead
Use CSS stylesheets to replace
Use CSS stylesheets to replace
Use CSS stylesheets to replace
width pre using CSS stylesheets instead
align, hspace, vspace img use CSS stylesheet instead
align, noshade, size, width hr use CSS stylesheet to replace
align, frameborder, scrolling, marginheight, marginwidth iframe use CSS stylesheet instead
autosubmit menu