[Javascript] Changing 2 attributes onClick

Trey H tutwabee at hotmail.com
Mon May 13 16:58:38 CDT 2002


Marcelo,
One small mistake can make the whole program wrong.  You forgot to put a 
double equals (==) instead of single equals (=) in your if statment.
you put:
  if (action='icon') {
and you should have put
  if (action=='icon') {

Also, I am not sure what the 'set' statement is.  Did you mean 'var' or does 
the set statement actually exist?

====================================
Trey: tutwabee at hotmail.com
Get free JavaScripts at the Blue Dragon!
Just go to:
http://www.websiter.biz
====================================
Make money by being online:
http://www.degoo.com/index.php?refid=tutwabee
===================================
Earn free traffic for your website easily:
http://tools.addme.com/servlet/popview?id=52260
====================================


>From: "Marcelo Simon" <grillo at lazzuri.com.br>
>Reply-To: javascript at LaTech.edu
>To: <javascript at LaTech.edu>
>Subject: [Javascript] Changing 2 attributes onClick
>Date: Mon, 13 May 2002 16:32:55 -0300
>
>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




====================================
Trey: tutwabee at hotmail.com
Get free JavaScripts at the Blue Dragon!
Just go to:
http://www.websiter.biz
====================================
Make money by being online:
http://www.degoo.com/index.php?refid=tutwabee
===================================
Earn free traffic for your website easily:
http://tools.addme.com/servlet/popview?id=52260
====================================

_________________________________________________________________
Join the world’s largest e-mail service with MSN Hotmail. 
http://www.hotmail.com




More information about the Javascript mailing list