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