Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #22756
| From | Joao Rodrigues <groups_jr-1@yahoo.com.br> |
|---|---|
| Newsgroups | comp.lang.javascript |
| Subject | Re: How to transform a image into clickable button? |
| Date | 2014-01-23 10:33 -0200 |
| Organization | Aioe.org NNTP Server |
| Message-ID | <lbr26j$7gp$1@speranza.aioe.org> (permalink) |
| References | <c53894b4-67ec-4764-a9ac-1fa52bc2e40b@googlegroups.com> |
Em 21/01/2014 19:14, vla.figueiredo@gmail.com escreveu:
> [ I'm really a noob on coding ]
>
> I'm creating a e-mail mkt with 2 buttons on it.
>
> I've already placed an image and linked with the right source from my
> server. Now I want to transform this image into a clickable button.
>
> How?
>
> tnx
>
You don't need a client-side JavaScript code to accomplish what you want
to do. E.g. (submitting a form):
<button name="btnSubmit" type="submit">
<img alt="" src="/img/select.gif" />
Submit</button>
However, you can use the button's onclick attribute to execute a JS
function for instance. In this case, you might use type="button" instead
of type="submit". E.g.
<button name="btn1" type="button" onclick="alert('hi')">
<img alt="" src="/img/image1.gif" />
Action 1</button>
<button name="btn2" type="button" onclick="alert('hey')">
<img alt="" src="/img/image2.gif" />
Action 1</button>
See:
<http://www.w3.org/TR/html401/interact/forms.html#edef-BUTTON>
<http://www.w3.org/TR/html401/interact/scripts.html>
--
Joao Rodrigues (J.R.)
Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
How to transform a image into clickable button? vla.figueiredo@gmail.com - 2014-01-21 13:14 -0800
Re: How to transform a image into clickable button? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-01-21 22:57 +0100
Re: How to transform a image into clickable button? Denis McMahon <denismfmcmahon@gmail.com> - 2014-01-21 22:30 +0000
Re: How to transform a image into clickable button? Joao Rodrigues <groups_jr-1@yahoo.com.br> - 2014-01-23 10:33 -0200
Re: How to transform a image into clickable button? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-01-23 16:01 +0100
Re: How to transform a image into clickable button? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-01-23 16:13 +0100
Re: How to transform a image into clickable button? "Jukka K. Korpela" <jkorpela@cs.tut.fi> - 2014-01-23 17:57 +0200
Re: How to transform a image into clickable button? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-01-23 17:08 +0100
Re: How to transform a image into clickable button? "Jukka K. Korpela" <jkorpela@cs.tut.fi> - 2014-01-23 18:37 +0200
Re: How to transform a image into clickable button? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-01-23 20:13 +0100
Re: How to transform a image into clickable button? "Jukka K. Korpela" <jkorpela@cs.tut.fi> - 2014-01-23 21:23 +0200
csiph-web