onclick="parent.location is not working in firefox and Chrome

<A ID ="CustomerInformation"></A>
<table class="SectionHeader1">
    <TBODY>
        <tr>
            <td>Customer Information</td>
        </tr>
    </TBODY>
</table>
<TABLE class="TheBox" align="center">       
    <TBODY>
        <TR>
            <TD>
            <FIELDSET><LEGEND>Customer Address</LEGEND>
            <DIV align="center">
            <TABLE id="table5" class="BoxedIn">
                <TBODY>
                    <TR>
                        <TH colspan="3" width="50%">Billing Address</TH>
                        <TH colspan="5" width="50%">Shipping Address</TH>
                    </TR>                       
                    </TR>
                </TBODY>
            </TABLE>
            </DIV>
            </FIELDSET>
            </TD>
        </TR>
    </TBODY>
</TABLE>    
<INPUT type="button" value="Customer Details"
                    class="buttonSuper" name="customerDetails"
                    onclick="parent.location='#CustomerInformation'"> 

The '#CustomerInformation' denotes the point where this script will jump to means same page.But it working fine in IE but not not working firefox and Chrome ..when click on onclcik button it is closing current page and go to main page.I tired like document.location and but no luck... Please help

Answers:

Answer

How about window.location instead?

Answer
<INPUT type="button" value="Customer Details" class="buttonSuper" name="customerDetails" onclick="location.href='#CustomInformation';"> 

This does what you're trying to do.

Edit: using location.href

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.