I'm currently creating a basic website but i'm strugling on my menu buttons part.
I have created a Home, Info & Contact us buttons etc, but how do I link these so from the home page I can select Info, Contact us etc, then select the home page. If someone can help me on this or point me in the right direction that would be great.

Recommended Answers

All 4 Replies

<a href="contact.htm"><img src="contact.jpg" /></a>

If you already have created buttons...you should be able to add the onClick property like below...

<input type="button" name="btnHome" text="Home" onClick="javascript:window.location.href='default.htm';" />
<input type="button" name="btnContact" text="Contact Us" onClick="javascript:window.location.href='contactUs.htm';" />
Member Avatar for rajarajan2017

If you created your menu with <input type="button"> then follow bhartman21 or else if you created your menu with <image> then follow pritaeas. Both will work.

you could actually just add the onclick event to any of the tags mentioned above:

<a href="#" onClick="javascript:window.location.href='contactUs.htm';">
    <img src="contact.jpg" />
</a>

- OR -

<img src="contact.jpg" onClick="javascript:window.location.href='contact.htm';" />

- OR -

<input type="button" name="btnHome" text="Home" onClick="javascript:window.location.href='default.htm';" />
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.