Inserting 'back to top' link dynamically using jQuery

Introduction Download I have seen many articles/blogs etc. on web that has huge information on a single page; some of them already using this technique that I am going to talk. Okay, for now look at the animated image given below. Note: Image size is 1.4 MB, please wait to respond. You can see, whenever I click on 'back to top' URL, page scrolls to top. At very first, you will think that I have inserted something like <a id="top1"></a> at the top and at the end of each <p> I have inserted URLs which is like <a href="#top1">back to top</a> to navigate to top. But you're wrong, this is not my technique. I have inserted these all dynamically, without looking the number of places to insert URL or how huge content do you have at the web page. You can use this feature anytime; all your earlier web page will start functioning. So, what's the magic behind. Let's look at the jQuery codes ...