James, The <button> tag is a different element created to allow much more control over styling and content - you can include markup such as images and styling in a <button> tag which is not possible with <input type="button">
As for which of the two approaches I prefer - I'd go for <a href="javascript:foo()"> as the javascript IS the link target, creating an onclick() handler and putting a fake value in the href attribute is to my mind misusing the tag. Alexandre's approach works - however unless you need to dynamically assign different click event handlers, I think it is better to put the event handler into the source rather than setting it with jQuery. Why force the browser to update its DOM with $('p').click(...) once the page is loaded when you can set it just by coding the tag? It'll slow the browser slightly as it updates the page after loading, which is cumulative if you have to do it for many links/tags. Hope all that info helps! --rob On 5/22/07, james_027 <[EMAIL PROTECTED]> wrote:
Hi, what is the difference between <input type="button"> to <button> Thanks james On May 22, 5:20 pm, Bob den Otter <[EMAIL PROTECTED]> wrote: > james_027 wrote: > > Hi, > > > Is this the best way to make a text button? > > > <a href="#">Click Me!</a> > > Slightly offtopic, but you might want to look into this: http://particletree.com/features/rediscovering-the-button-element/ > > Besides the <button> tag, they also go into styling <a> tags to resemble > buttons. > > Best, Bob.
-- Rob Desbois Eml: [EMAIL PROTECTED] Tel: 01452 760631 Mob: 07946 705987 "There's a whale there's a whale there's a whale fish" he cried, and the whale was in full view. ...Then ooh welcome. Ahhh. Ooh mug welcome.