0

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...!!!

3
Contributors
4
Replies
5
Views
8 Years
Discussion Span
Last Post by farshidk
0

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?

0

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();" />

0

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.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.