Home button not working

Posted on 2011-05-09
Last Modified: 2012-05-11
The button appears but nothing happens. What am I doing wrong?
echo "<div id='home'><FORM><INPUT TYPE='button' VALUE='HOME' onClick='location.href=../../index.html'></FORM></div>";

Open in new window

Question by:genesisvh
    LVL 13

    Accepted Solution

    the javascript for the onclick should be window.location="../../index.html";

    Author Comment

    No that didn't work either
    LVL 13

    Expert Comment

    is the onclick firing at all?
    To double check that try putting an alert in there so that you know that something is firing.
    So put onclick='javascript:alert("this is the onclick");'
    LVL 33

    Expert Comment

    Is the page two levels deep in your site?  What if you used "/index.html" instead of "../../index.html"?
    LVL 107

    Expert Comment

    by:Ray Paseur
    How about just this:

    <a href="/">Home</a>

    You can style that link if you want to.

    Author Closing Comment

    It did work just had to work the syntax error.
    echo "<div id='home'><FORM><INPUT TYPE='button' VALUE='HOME' onClick=window.location='../../index.html'></FORM></div>";

    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    Join & Write a Comment

    Part of the Global Positioning System A geocode ( is the major subset of a GPS coordinate (, the other parts being the altitude and t…
    Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
    In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
    In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now