<span id=hello>Hello</span> <script> $('#hello').append(' World'); alert($('#hello')); // Will say "Hello World" // Puts the byte span after the hello span $('#hello').after('<span id=bye>Bye</span>'); alert($('#bye')); // Will say "Bye" </script>
Programming Tips - jQuery: What's the different between append() and after()
Date: 2013oct1
Library: jquery
Language: javaScript
Q. jQuery: What's the different between append() and after()
A. append() puts more stuff *inside* the selected node at the end.
after() puts more stuff following the selected node -- not inside it.
For example: