[HTML] basics 01 and html01
Basic HTML knowledge Review
1: ie is a type of browser. Generally, the browser only uses the IE internal box, and knowledge outsourcing IE.
2: When writing HTML, you must follow the XML standard class. If there is a start, there will be an end.
3: single double quotation marks for HTML attributes are acceptable or not written. HTML and XML are the same and both are used. <! __> For comments.
4: <p> </p> Create a paragraph;<Br/> Press enter. in HTML, some tags do not need to be closed. In this case, br is the same. This is different from XML. Generally, all tags must be closed. <Br/>
5: "" is not used as a space in HTML. To express a space, & nbsp must be used to indicate a space. Because there are often indentation in HTML, the page layout will be messy.
6: <p> label is used for segmentation. Why <> use <less than] and <dt [greater than], because <> in HTML has different meanings.
7: <pre> the intermediate fields can be output in the writing format. </pre>
8: the image is linked as soon as it is clicked, and the image is not inserted.
9: table
*: <Thead> </thead> indicates the header, <tr> indicates the row, and <td> indicates the column.
10: Form
*: <Form> is a form label. If you want to submit data to the database, you need to put <input>, <textarea>, <select> and other form elements into the form.
*: <Form action = ''> the last page of the action attribute.
*: <Input> is the main form element. The optional value of type is: <submit>: submit button; <button> normal button; <checkbox> check box; <file> file selection box;
* <Select> the label is used to indicate the ComboBox or ListBox. If the attribute size is greater than 1, it is ListBox. Otherwise, it is ComboBox.
*: If the attribute size is greater than 1, it indicates ComboBox; otherwise, it indicates ListBox.
11: css stacked style sheets are used to beautify webpages.
* Inline: beautify a tag;
* Page embedding: beautify a type of labels. Set <style> in
* External reference: <link type = "text/cssw.relw.'styleheet'hrefw.'css1.css '>
[JavaScript] <weak type language>
1: format, written in
<Script>
Alert ('output content ');
</Script>
2: External Reference
<Script src = 'common. js' type = "Text/JavaScript"></Script>
3: JS is an interpreted line language, not a compilation type, and sometimes some errors will be executed in the same way. It has nothing to do with JAVA, and the basic form is the same as that of C.
4: No type in js. use var to declare the variable. The following code is correct in JS, but is wrong in.
Var I = 10;
I = "abc ";
Alert (I); this will output abc without errors.
5: determine its variable Initialization
Var x;
If (! X) {alert ('No x');} indicates that the variable is initialized, the variable is not empty, or the variable is not 0.
6: The function declaration does not need to declare the return value type, parameter type. Not all functions return values.
Function add (i1, i2 ){
Return i1 + i2;
}
7: there are also events in js, which are only included in some hyperlinks.
<A href = "JavaScript: alert ('click me')"> </a>
<Input src = "a. js" onclick = "clert ('click me')" type = "JavaScript">
8: anonymous Functions
Var F1 = function (a, B ){
Return a + B;
}
Alert (F1 (12.10); Output 22.
9: JS object-oriented Basics
** Js does not have the class syntax. It is simulated by function closures. In JS, classes such as String and Date are called object "".
* ******** Example
Function Person (name, age) {// can be viewed as a constructor, while name and age can be viewed as attributes.
This. Name = name;
This. Age = age;
This. SayHallo = function (){
Alert ("Hello, I am" + this. Name + ", I am" + this. Age + "years old ");
}
}
Var P1 = new Person ("man", 20 );
P1.SayHello (); the class name must be declared
10: Array
**: The array in js is a dynamic array with no size limit and no length limit.
Var names = new Array ();
Names [0] = "tom ";
Names [1] = "son ";
For (var I = 0; I <names. length; I ++){
Alert (names [I]);
}