jQuery/JavaScript code snippet to simulate a back button based on the users last web page.

		return false;
Tags: jQuery Back Button, jquery previous page
Sam Deering is a Front-end Web Developer who specialises in JavaScript & jQuery. Sam is driven and passionate about sharing his knowledge to educate others.

Free Guide:

How to Choose the Right Charting Library for Your Application

How do you make sure that the charting library you choose has everything you need? Sign up to receive this detailed guide from FusionCharts, which explores all the factors you need to consider before making the decision.

  • Pingback: jQuery Back Button (go to previous page) « Big Engine Media()

  • http://www.ChiefAlchemist.com Mark “Chief Alchemist” Simchock

    Simply yet helpful, thanks.

    But what if there is no history? For example, the page’s URL is shared via social media. Might there be an easy way to suppress the displaying the link that is assigned the .back?

  • http://www.ChiefAlchemist.com Mark “Chief Alchemist” Simchock
  • http://technoslab.blogspot.com Manish

    Very useful and handy.

  • ksankalpa

    thanks a lot ,,common solution for most problems

  • mimi

    Letter Registration Form
    function goBack () { history.go(-1); return false; }

    Search By :

    (please select Your choice:…)


    Tarikh Penerimaan
    No.Fail Kementerian Ibu Pejabat
    Nombor-Nombor yang lain
    Tarikh Surat
    Daripada siapa
    Dirujukkan kepada
    Dokumen difailkan


















































    //this mycode idon’t why button back not function..

  • mimi

    not that one..sory..this one…

    KandunganForm Kandungan/Content :  

  • chandu

    history.back(); also working for mee

  • Gary

    Thanks Sam, please could you let me know where to add the code.

  • Gloumi

    You save my life, thanks!

  • Sachin

    Thanks! This really helper!

  • azerty


  • mahmoodi


  • Dinky

    thanks, mate.

Special Offer
Free course!

Git into it! Bonus course Introduction to Git is yours when you take up a free 14 day SitePoint Premium trial.