Hi, how can I assign an action to an icon? For example, I have a print or close icon and I insert it in my webpage, now how can I assign appropriate actions to the icons?
Please help...!!!

use onclick="doSomething();" for icon images.

use onclick="doSomething();" for icon images.

Thank you Luckychap, would you please try to explain more, for example for "close window", "print window" and/or "back" actions. are there any parameter needed in the string?

Hi...
for this icon...
you can put the following things...

This will print your page..
<img src="...." onclick="javascript:window.print();" />

This will go back..
<img src="..." onclick="javascript:history.back(-1);" />

This will close the window
<img src="..." onclick="javascript:window.close();" />

Hi...
for this icon...
you can put the following things...

This will print your page..
<img src="...." onclick="javascript:window.print();" />

This will go back..
<img src="..." onclick="javascript:history.back(-1);" />

This will close the window
<img src="..." onclick="javascript:window.close();" />

hi guys...
many thanks for your replys, i tested the codes & they exactly solved my problem.

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.