One, CSS four kinds of selectors1. Classes selector (class selector)
Basic use
. class Selector {
Property Name: property value;
....
}
2. ID selector
Basic use
#id选择器 {
Property Name: property value;
....
}
Case:
Use of the/*id selector */
#id1 {
Background-color:silver;
font-size:40px;
}
3. HTML element Selector
(HTML priority is lower than ID and class selector)
An HTML element {
Property Name: property value;
...
}
4. Wildcard selector
The selector can use all HTML elements, but it has the lowest priority
*{
Property Name: property value;
....}
Four selector Priority
ID selector > class selector > HTML selector > Wildcard check
The difference between the value in JS and the Val () in jquery
one is jquery object, one is Dom Object
document.getElementById ("id value"). value==$ ("#id值"). Val ()
Iii. differences between the Submit and button
Type=button is simply a button function
Type=submit is the Send form
(1) Submit the form submission (Form.submit ()) as the default event after its onclick, the button is not
(2) When a form is submitted, all HTML input elements with the name attribute (including input tags, button labels, select Labels, and so on) are submitted as key-value pairs, except for the Submit object. The Submit object is only submitted as a key-value pair in the commit after it has been clicked.
But for the Web UI people should be aware that using submit to improve the usability of the page:
After using submit, the page supports keyboard enter operations, while many web software designers may not notice the submit unification.
The page does not support the ENTER key after the button is used. Therefore, you need to support the ENTER key, you must set a submit, the default enter key to the first submit to the page operation.
After executing the onclick, go to action. You can automatically submit no onclick required. So, the onclick here can not be.
After executing the onclick, the jump file is controlled in the JS file. Submit requires onclick.
Like what:
1,onclick= "form1.action= ' a.asp '; Form1.submit ();" This enables the function of the submit.
White, that is, the submit will have a jump, the page will refresh, and button will not refresh, is a button; You can use <button type= "Submit/button/reset" ></button> To generate buttons that are more flexible and style better controlled.
Iv. How to Get ID value in JS
handwritten a form, handwritten a tableform:
form (required below):
Vi. What are the attributes of the form tag and explain
- Name: Names of the forms
- Method: Defines how the form results are routed from the browser to the server, usually in two ways get and post
- Action: the location (relative or absolute) used to define the form handler (a asp,cgi, etc.)
- Enctype: Setting the encoding of form data
- Target: Sets how the returned information is displayed
Name property
You can control the relationship between a form and a background program by naming the form.
Method property
In the method property, the Get method appends the contents of the form to the URL address, so that the length of the commit information is limited to no more than 8,192 characters. If the information is too long, it will be truncated, leading to unexpected processing results. At the same time the Get method is not confidential, not suitable for processing such as credit card number requirements of confidential content, and can not transmit non-ASCII characters.
The Post method is to include the data that the user fills in the form in the body of the form, which is transferred to the handler on the server, which has no character restrictions, it contains the ISO10646 character set, is a mailing method, the address bar of the browser does not display the submitted information, There is no limit to the data transmitted in this way.
When you do not specify which way, the default is Get mode.
Enctype Property (Learn)
There are several ways to set the encoding of form information submissions:
Text/plain: Transmitting information in plain text
Application/x-www-form-urlencoded: The default encoding form
Multipart/form-data: Using mine encoding
Target Property
Sets the window that the form information returns.
The value of target has the following types:
_blank: Displays the returned information in the newly opened browser window
_parent: Displays the return information in the parent browser window
_self: Displays the return information in the current browser window
_top: Displays the return information in the top-level browser window
Summary:
Communicate with the Master B/s learning experience and so on, the master pointed out a lot of problems, a promotion level of opportunity (especially let handwriting of all kinds of things, almost did not write up, is an impression). Thank you, Liu Jie Master O (∩_∩) o~~
Not to be continued ...
b/S Road long Summary (a)