Javascript knowledge collection

Source: Internet
Author: User

 

I have never paid much attention to javascript before, and the level of writing code is always half-baked. If you don't understand it, you can write something, and write something. There are often many vulnerabilities in writing :(

Recently, I am immersed in javascript. Especially in writing javascript code correctly and javascript performance.

 

Today, let's start with the simplest knowledge.

 

 

Generally, operations on the DOM structure or many other situations are written on the basis of jQuery, which leads to many times limited to the javascript framework, some native javascript methods or attributes are ignored.

 

 

Q1: How do I obtain the elements selected by the current mouse on the page?

 

A1: When jQuery is used, you should immediately think of several events it provides [focus (), focus (fn), focusin (fn), focusout (fn)]. You can use these methods to obtain the expected results. However, javascript itself provides a method, which is simpler: document. activeElement. id returns the id of the element with the current focus.

 

 

From the column of dripping water and stone

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.