tags:

views:

45

answers:

3

Besides <input type="button" value="Click me" />, <input type="submit" value="Click me" />, <a>Click me</a>, is there another way that can make "Click me" clickable?

+1  A: 

By clickable do you mean something other than that it causes JavaScript onClick events to fire? Any DOM component should do that. If you want to change the cursor to indicate that something will happen when text is clicked, you can do that with CSS.

Tuure Laurinolli
I mean the mouse cursor will change when you hover it over the text.
Steven
+2  A: 

With Javascript and CSS, you can make almost everything click-able.

<img src="photo-thumbnail.jpg" onclick="popup_image('photo.jpg');" style="cursor:pointer;" alt="" />

Setting cursor:pointer will make an element look clickable.

But again, that will only work if Javascript is enabled.

thephpdeveloper
Awesome! It works as if by magic.
Steven
If it works, put a tick by the side so that others know which is the answer.
thephpdeveloper
I have put a tick. Is it okay?
Steven
yeah =) awesome.
thephpdeveloper
+2  A: 

You can use Javscript:

<span onclick="...">Eat me</a>

This of course only provides the reaction to the click, if you want to make it look clickable also you have to add some styling.

Guffa