4th days: web-related knowledge (HTML + CSS + JavaScript)

Source: Internet
Author: User

Html
Hyper Text mark-up language
Chinese name: Hypertext Markup Language
CSS
Cascading Style Sheet
Chinese name: stacked style sheet
Tag Selector
Class Selector
Id Selector
Derived Selector
CSS positioning
Display: None Not Displayed
Display: Block Element
Display: inline Row Element
Javascript
(1) usage:
Data Verification
Add dynamic effects to pages
Dynamically change the page appearance
Ajax jquery
(2) Introduction of JavaScript scripts
Embedding elements in the page <a href = "javascriptlalert ('helloword');">
Put it in the file separately <SCRIPT type = "text/JavaScript" src = "js01.js"> </SCRIPT>
<SCRIPT type = "text/JavaScript"> alert ("helloword"); </SCRIPT>
(3) Common Data Types
Number string Boolean null undefiend
Converts a string to a value of parseint () parsedouble ()
Convert a value to a character totring ()
Attributes and methods in strings
Length attribute string length
Charat (INDEX) returns the character at the specified position
Substring (from, to) returns the substring
Indexof (STR) returns the index of STR that appears for the first time in the string.
Match (RegEx) returns a qualified Array
VaR Reg =/[0-9]/g;
VaR STR = "ssjjk333khh20k"
VaR rs = Str. Match (REG); returns {333,20}
Whether test (REG) meets the conditions
VaR reg2 =/[0-9]/g;
VaR STR = "skl234 ";
VaR rs = reg2.test (STR); Return boolean data
Search (RES );
Touppercase (); converts to uppercase
Tolowercase (); lowercase
Array
VaR newarray = new array ();
Length attribute
Tostring ()
Concat (); connects two Arrays
Join (); concatenates elements in the array into strings
Reverse (); reverse an array
Slice (); truncate part of the array and return a new array
(4) common events
Onclick (); mouse click event
Onchange (); event triggered when the content changes
Onfocus (); the mouse obtains the focus event
Onblur (); mouse focus loss event
Onload (); element loading event
Onmouseout (); move the mouse out
Onmouseover (); move the mouse over
Ondblclick (); Double Click Event
(5) Dom Model
A. How to access elements in the page
VaR OBJ = Document. getelementbyid (idname );
OBJ. value;
<Div id = "idname">
Prototype. js
$ (Idname );
$ Fun (idname );

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.