JS's regular, form validation, Dom model

Source: Internet
Author: User

Regular: Rules            syntax var a=/expression/input value to include an expression                 var a1 = new RegExp (' expression ')                  Retrieving---expressions. Test (entered value) returns a Boolean type                  Regular symbols (regular for multiple symbols, with ())                 ^---Enter a value that is the first digit of the character after the symbol                 $---End with a character before the symbol                + characters before the----symbol can appear multiple                 * characters before---symbol can occur any number of times                 ? ---Symbols can occur 0 or 1 times before                {N}---Symbol must be available n times before character, but to start, end                 {n,}---symbol can appear at least n times before the character, but to start, end                 {N,M}--the symbol pre-character can appear at least n times up to M times; but to add a start, end                 . ---match any character except/r/n               | ---or (a|b) $ A end b all lines                [a-z]-- -Match all (lowercase) A to Z characters---var a =/[a-z]/;                [^a-z]--matches all not (lowercase) A to Z characters---var a =/[^a-z]/;                 Capital Letter [a-z]  Capital-lowercase [a-z]                /^[a-z][0-9][a-z]&/; ---this type of alphanumeric notation can only be written in one                 numbers [0-9] = = =/d    /D means non-numeric                [any character] Match a                   of any character inside          Form Validation                  use JS, regular to fill in the value of the Judgment                      dom Models                 html Dom:html's standard programming interface----defines the objects and properties of all HTML elements and how to access them                      dom is the standard for how to get, modify, delete, and add HTML elements                dom Node:         &NBsp;            Gets the element node: 1.document.getelementbyid, etc. return to node object                       ADD: Create new element createelement  CreateAttribute (Create Attribute) createTextNode (create text)                            The newly added node is appended to the Touch node   (node: label, text) parent node. appendchild (child nodes)                       new Attribute node appended to the label where the attribute needs to be added. Setattributenode (properties created)                       Property Assignment: Label name. SetAttribute (attribute, value)                           insertbefore (the Label object to insert, before which label you want to insert)                             need to use body because all are inserted in body                            Replace: ReplaceChild (the element you want to replace, the element that needs to be replaced)                                                               replication 1. Latent copy                                          the element that needs to be copied. CloneNode (false) to append to the element you want to add in the end                                          Copy labels only                                     2. Deep copy                                          elements that need to be copied. CloneNode (true) Finally append to the element you want to add                                          Copy tags and contents                                                          Delete: Delete is determined by parent element                                 parent element. RemoveChild (elements that need to be removed)                             Modify: Modify CSS styles such as HTML content innertext   document.getElementById (). Style.color     DOM Summary: Add, delete----is the parent node of the child node operation, (add sometimes) need reference             Modify, Get----As long as you know the element attribute (signature, class value, id) I can get all of your information and can make changes            

JS regex, form validation, Dom model

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.