Once we click on "Login" button present in pop up, we want to change text "Login" to "Logout" present on top menu.

enter image description here

So i tried as CodePen , now i can able to change text from "Login" to "Logout" , along with this i want to give Logout url : <url helper="customer/getLogoutUrl"/> , is this possible ?

Login1 - pop up : app/design/frontend/rwd/Theme1/template/productlike - index.phtml

<input onclick="change();" type="submit" value="Login1"  />


function change() {
    var elem = document.getElementById("delUserButton")
    if (elem.value === "Login2")
        elem.value = "Logout";
        elem.value = "Login2";

Login in top menu [Login2] - app/design/frontend/rwd/Theme1/layout - customer.xml

        <reference name="top.links">
            <action method="addLink" translate="label title" module="customer">
            <![CDATA[<p><input  type="button" id="delUserButton"  value="Login2" /></p>]]>
            <url helper="customer/getLoginUrl"/><title>Log In</title>       
        <remove name="reorder"></remove>

1 Answer 1


I need to do more research before posting question , below code will make the trick :

<![CDATA[<p><a href="customer/account/logout"><input  type="button" id="delUserButton"  value="Login2" /></a></p>]]>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.