When learning javascript, I made a javascript Application: Scaling navigation.Key knowledge points: Get the elements of the trigger event handle, such as . When an onclick event is triggered, obtain the elements of the event, the 'target' attribute
This is a keyword in Javascript.
It indicates an internal object automatically generated during function running and can only be used within the function. For example,
Function test (){
This. x = 1;
}
The value of this varies with the function usage.
People always like to add custom attributes to HTML tags to store and operate on data. However, you do not know whether other scripts will reset your custom attributes in the future. In addition, if you do this, the html syntax does not conform to
Copy codeThe Code is as follows:Syntax:$ (Function (){Var callback = function (r) {// r indicates the data returned by the background data.}$. Get ("", callback); // path of the write method in quotation marks});In this way, the data obtained by the
Used to process DOM element attributes of XML documentsCopy codeThe Code is as follows:ChildNodes: returns an array of all child elements of the current element;FirstChild: returns the first sub-element of the current element;LastChild: returns the
Let's take a look at my code. Just embed the code into a page file.Example 1 Use regular expressions to obtainCopy codeThe Code is as follows:Var LocString = string(registry.doc ument. location. href );Function getQueryStr (str ){Var rs = new RegExp
Copy codeThe Code is as follows: click the text pop-up layer 1111111111111111111111111222222222222222222222222222222222222222222222222222 mobile phone number: 1. There is a delay when the network is busy. Please do not send it multiple times
Copy codeThe Code is as follows: the button becomes grayed out after the form is submitted and --> javascript :{ this. disabled = true; document. form1.submit ();} ">
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