![]() |
| ||
| buttons in html Hello, how do you add a custom button to a webpage and link it to another page? ANother question is how can you make the button rollover when someone's mouse is over the button and when they click the button? Would I need javascript? Thanks |
| ||
| Re: buttons in html To create a button, use the "input" tag, with the type attribute set to "button": <input type="button" id="myButton" /> To make it perform an action, including navigating to another site, code the "onclick" attribute. The value will be a JavaScript function you've written and included elsewhere in the document (in the HEAD section, within SCRIPT tags), or will be inline JavaScript itself: <input However, might I suggest another technique entirely? Use standard hyperlinks. Using CSS, you can make them look and behave exactly like buttons, with no JavaScript. <html> Replace the "#" sign in the href tags, with the actual URL of the target page. This technique will accomplish all your stated goals. |
| ||
| Re: buttons in html What about doing it without javascript. Like i have a button that I made, how can I put that on my page, and make it go to another page. Do you use </button> tags, and if you can how would you set the image as the button? I like the css version, very clever. Thanks |
| ||
| Re: buttons in html Buttons are made with <form> tags. in it, you specify the destinations when it's presses. As for as rollovers, yes, there are custom bottons in javascript you can use. |
| ||
| Re: buttons in html No, no no. Read the first part of my first reply. Buttons are made with "input" tags, and can be made to perform navigation tasks with the "onclick" attributes. Re-read the first part of my first reply. |
| ||
| Re: buttons in html I found a solution without using javascript: <p><a href="#"><img src="some_image" width="150" height="50" border="0" id="button"/></a></p> |
| ||
| Re: buttons in html But that isn't a button... that's an image within a hyperlink. :) Yes, if you want a hyperlinked image, you simply... make a hyperlinked image. :rolleyes: |
| All times are GMT -4. The time now is 3:30 am. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC