Write the HTML structure of the DOM element first:Copy codeThe Code is as follows:Copy codeThe Code is as follows: John Resign George Martin Malcom John Sinclair J. Ohn Has p I.: contains (text)Select an element with the text content as
This section describes how to add, modify, or delete attributes and methods for an object. In other languages, once an object is generated, it cannot be changed. To add a modified member to an object, you must modify it in the corresponding class
1. event. preventDefault (); -- block the default event of the element.Note: The default event for clicking to jump to element,
Default events for button, radio, and other form elements,
No Default event for the div Element
Example:Copy codeThe Code
SetInterval is a very useful js function that can be used to repeatedly execute some functions. With this, we can implement some interesting functions, such:
If you do not click New pages, "real-time" will receive greetings from other Members and
Copy codeThe Code is as follows:Function NewDate (str) {str = str. split ('-');Var date = new Date ();Date. setUTCFullYear (str [0], str [1]-1, str [2]);Date. setUTCHours (0, 0, 0, 0 );Return date;}Therefore, to ensure compatibility in various
In this article, I don't know what ajax is like to use ajax skillfully.
I. the most primitive way to use ajaxCopy codeThe Code is as follows:Personal analysis: This method is good, simple, and flexible, but it is not good, that is, there are many
1.
Under our normal understanding, the execution sequence of this code should be: defer, script, and load. However, if the order of the Code is: script, defer, load in a browser that supports defer, note that defer is called before the onload
The effect is as follows: The implementation code is very small and concise. You can refer to the learning method.Copy codeThe Code is as follows: Copy codeThe Code is as follows: high praise ranking 1 Wuliangye rating rating: score: 8.6
Copy codeThe Code is as follows:// Expand the row that meets a conditionFunction expendRow (){Var I; // temporary variable for LoopVar arr = []; // array of rows to be expandedFor (I = 0; I {Var record = ProdRequireInfoStore. getAt (I); // traverse
Searches for parent-level and peer-level elements are frequently used. The following describes how jQuery is implemented. If you are interested, refer
JQuery. parent (expr) finds Father's Day points and can pass in expr for filtering, for example, $
DOM is a standard for getting, modifying, adding, or deleting HTML elements. The following describes how to operate html dom nodes. For more information, seeHtml dom is a standard for getting, modifying, adding, or deleting HTML elements. In html
This article mainly introduces the sample code for de-duplication and de-duplication of JS arrays. If you need it, you can refer to it for help.Method 1: code for deduplication: Method 2: the code for getting duplicate data is as follows:
This article mainly describes the features of the Array stack method and queue method in detail. If you need a friend, you can refer to it and hope to help you.Stack method: last in first outside queue method: the application of first in first
During project development, arrays often contain a lot of repeated content, that is, dirty data removal operations. This article focuses on several methods of array deduplication. For more information, see.1. according to the principle that keys in
The following section briefly introduces the application of reverse (), sort (), concat (), slice (), and splice () methods in Array. Let's take a look.The Code is as follows: reordering method and operation Method
In this example, you can use the mouse to slide and display details. The code is concise and suitable for learning.For example, the implementation code is very small and concise. For more information, see the learning code: the code is as follows:
This article mainly introduces the quick solution to the conflict between JQuery $ and other JS files. If you need it, you can refer to it for help.As we all know, jQuery is currently the most popular JS package, which simplifies many complicated JS
Directly call window. print (), but after printing, the font is always reduced to 1, and then directly target = "_ blank" to print it normally. below is the implementation codeToday, we will make a small function for printing web pages. We will call
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