A client has a web page with a series of tasks. They want to implement a reordering feature that behaves like the following example:
After performing the clicks shown in the animation above, the document's body should be:
<div> <span>Prepare presentation</span> <button class="downButton" type="button">↓</button> </div> <div> <span>Read emails</span> <button class="downButton" type="button">↓</button> <button class="upButton" type="button">↑</button> </div> <div> <span>Monthly report</span> <button class="upButton" type="button">↑</button> </div>
Implement the function initialize to add the requested functionality. The reordering behavior should work with any number of tasks.
- DOM Manipulation
- Event Handling
Duration: 30 min
Author: Josip Kremenić
Score DistributionNot enough data for chart.
Would you like to see our other questions?
We have 1000+ premium hand-crafted questions for 160+ job skills and 20+ coding languages. We prefer questions with small samples of actual work over academic problems or brain teasers.
Would you like to see our tests?
On the blog
Since we're all biased and we use incorrect proxies, why not just outsource hiring to experts or recruitment agencies? After all, they've been screening people for many years, so they must know how to do it right?
Not really. I was surprised to discover that many experts...