Document
The last sentence oUl.insertBefore(oLi,oLi[0]); Why can’t I choose to insert at oLi[0]? I want it to be inserted at the front every time I click? Instead of creating a li every time you click, and then inserting it before the 0th index, it should be no problem.
The second parameter indicates inserting newnode before this node. If it is null or undefined, the insertBefore method will add newnode to the end, which has the same effect as appendChild