Alibaba school recruit: front-end online pen questions-calculate the duration of the mouse in a certain area of the page

Source: Internet
Author: User

School recruitment: Alibaba front-end pen questions
After receiving the written test notice, I spent a few days filling out the previous year's written questions from Alibaba's front-end. Coincidentally, some of you have done this question this year and sent it to the beiyou BBS (it seems that it is still useful to take a shot in the past ), paste the Code submitted at the time.

The level is limited. Please advise if there are any errors.

Question:

<Div class = 'mod-SPM 'data-spmid = '000000'> <divclass = 'child _ a'> </div> <divclass = 'child _ B '> </div> <divclass = 'child _ C'> </div> <divclass = 'child _ d'> </div> <divclass = 'mod-SPM 'Data-spmid = '000000'> <divclass = 'child _ a'> </div> <divclass = 'child _ B '> </div> <divclass = 'child _ c '> </div> <divclass = 'child _ d'> </div> <divclass = 'mod-SPM' data-spmid = '20140901'> <divclass = 'child _ a'> </div> <divclass = 'child _ B '> </div> <divclass = 'child _ C'> </div> <divclass = 'child _ d'> </div> the DOM structure is as follows, use the native code (disable jquery to answer) to implement the following functions: (a) Calculate the duration of the mouse in the mod-SPM region. Data-SPM is regarded as different regions (B) minimize performance loss (c) repeated entry into time Accumulation

The Code is as follows:

<HTML> 

 

Alibaba school recruit: front-end online pen questions-calculate the duration of the mouse in a certain area of the page

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.