09.04 JavaScript Event Object time bubble and capture node gets elements from HTML by ID name Tag name class Selector

Source: Internet
Author: User
Tags tag name

# Event Object
# # Event Category
* MouseEvent
* KeyboardEvent
* FocusEvent

# # Property
* ClientX
* ClientY
* KeyCode
* Target specific Trigger event element

The AppendChild () method adds the last child node to the node.

< Span style= "COLOR: #808080" >

### method
* stoppropagation ()     block bubbling
* preventdefault ()        block default action


Bubbling and capturing of # # # Events

< Span style= "COLOR: #808080" >



# node
Span style= "COLOR: #b22222" >### node classification
* document       9
* element          1
* attr             2
* text                3
* comment       8

< Span style= "COLOR: #b22222" > < Span style= "COLOR: #808080" >
### property
*  NodeName
* nodevalue
* nodetype


# get elements from HTML
### through ID
* getelementbyid ()
*  an element with an id attribute that automatically generates a global variable with the same name


# # # By Name property
* Getelementsbyname ()
* ie9+ all elements have the name attribute
* ie9-individual elements have the name attribute

# # # Signed by Mark
* getElementsByTagName ()
* Docuemnt.images
* Document.links
* Document.anchors
* Document.forms


# # # by class type
* Getelementsbyclassname ()
* ie9+

# # # via Selector
* Document.queryselector ()
* Document.queryselectorall ()

# # Document.all
*  all elements in the document




# The structure of the document node
### node relationship
*  parent       Parent Element
*  child nodes        child elements
*  Brothers node      sibling element
*  Ancestor node      ancestor element
*  descendant nodes     descendant elements

Span style= "COLOR: #b22222" >### node related properties
* parentnode
* childnodes
* firstchild
* lastchild
* nextsibling  next sibling element
* previoussibling previous sibling element

 

< Span style= "COLOR: #808080" >
### element-related elements
*  parentelement
* children
*  firstelementchild  ie9+
*&NBSP;LASTELEMENTCHILD&NBSP;&NBSP;&NBSP;IE9 +
* nextelementsibling    ie9+
* previouselementsibling   ie9+
* childelementcount    number of child elements   ie9+
* ownerdocument     ie9+

09.04 javaScript Event object time bubble and capture node gets elements from HTML by ID name Tag name class selector

Related Article

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.