(newNode) In the method, if the newNode itself is a node in the Dom, then the appendChild method will no longer be executed
It's an append operation, but a move operation. For example:
[Ctrl+A Select all Note:Introducing external Js requires refreshing the page before execution]
Because btn1 itself is a node in the dom, the appendChild operation will move btn1 behind btn4 instead of copying.
Using this feature, we can use a very small amount of code to achieve seamless text scrolling.
[Ctrl+A Select all Note:Introducing external Js requires refreshing the page before execution]
Haha, isn't it very concise? I posted this method on CSDN in May this year, which attracted a lot of JavaScript hobbies at that time
The big discussion of the post was topped by the CSDN homepage, and 300 people participated in the reply to the discussion.
In addition to this application, this feature of appendChild can also show off its skills in table sorting.
Note that the following table sorting code is just to illustrate the usage of appendChild and is not tested in ff.
[Ctrl+A Select all Note:Introducing external Js requires refreshing the page before execution]
How about it? With the help of appendChild, this sort is simple enough.
For more operation methods and advanced custom table sorting, please see my other post on CSDN (also the sorting implemented using appendChild, and is compatible with firefox)
It's an append operation, but a move operation. For example:
[Ctrl+A Select all Note:Introducing external Js requires refreshing the page before execution]
Because btn1 itself is a node in the dom, the appendChild operation will move btn1 behind btn4 instead of copying.
Using this feature, we can use a very small amount of code to achieve seamless text scrolling.
[Ctrl+A Select all Note:Introducing external Js requires refreshing the page before execution]
Haha, isn't it very concise? I posted this method on CSDN in May this year, which attracted a lot of JavaScript hobbies at that time
The big discussion of the post was topped by the CSDN homepage, and 300 people participated in the reply to the discussion.
In addition to this application, this feature of appendChild can also show off its skills in table sorting.
Note that the following table sorting code is just to illustrate the usage of appendChild and is not tested in ff.
[Ctrl+A Select all Note:Introducing external Js requires refreshing the page before execution]
How about it? With the help of appendChild, this sort is simple enough.
For more operation methods and advanced custom table sorting, please see my other post on CSDN (also the sorting implemented using appendChild, and is compatible with firefox)