[Javascript] Changing 2 attributes onClick

Selvaraj, Murugan (Indsys) Murugan.Selvaraj at geind.ge.com
Tue May 14 00:20:33 CDT 2002


Hi Marcelo 
 
For comparing the string you should use "==".You should not use "=".
In your javascript code you have used action='icon'.Change this code as
action =="icon"
 
It will work
-----Original Message-----
From: Marcelo Simon [mailto:grillo at lazzuri.com.br]
Sent: Tuesday, May 14, 2002 1:03 AM
To: javascript at LaTech.edu
Subject: [Javascript] Changing 2 attributes onClick



Hi, I'm trying to change 2 attributes of 2 diferent tags when I click on an
image. I've came with this code:
 
<td><a name="blahref" id="blahref" href="i_emoticons.cfm"
target="blahbox"><img src="images/bt_emoticons.gif" name="blahicon"
id="blahicon" width="18" height="16" border="0"
onClick="blahbutton();"></a></td>
 
and the blahbutton functions as this:
 
function blahbutton() {
 if (action='icon') {
  set action='box';
  document.blahicon.src ='images/bt_blahbox.gif';
  document.blahref.href ='i_blahbox.cfm';
 }
 if (action='box') {
  set action ='icon';
  document.blahicon.src ='images/bt_emoticons.gif';
  document.blahref.href ='i_emoticons.cfm';
 }
}
 
can someone point me out why this isn't working? it's for IE only.
 
TIA
Marcelo Simon



"THIS E-MAIL MESSAGE ALONG WITH ANY ATTACHMENTS IS INTENDED ONLY FOR THE
ADDRESSEE and may contain confidential and privileged information.
If the reader of this message is not the intended recipient,
you are notified that any dissemination, distribution or copy of this 
communication is strictly Prohibited. 
If you have received this message by error, please notify us 
immediately, return the original mail to the sender and delete the 
message from your system."

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.evolt.org/pipermail/javascript/attachments/20020514/479bb0cd/attachment.htm>


More information about the Javascript mailing list