Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 3 of 3

Thread: onClick

  1. #1
    JR
    JR is offline
    Senior Member JR's Avatar
    Join Date
    Nov 2002
    Location
    UK
    Posts
    4,354
    Member #
    257
    I have this as a part of a function, the three numbers for R, G and B are meant to be added then the onClick is changed. Why isn't this working:
    Code:
    document.getElementById('color1').onClick = 'selector('+red+','+green+','+blue+')';
    JR

  2.  

  3. #2
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Location
    Boston, MA
    Posts
    9,729
    Member #
    819
    Liked
    205 times
    Not 100% sure what I'm looking at here, but maybe you should try putting the "onClick" event IN the element with the id "color1", like so:

    <element id="color1" onclick="selector('+red+','+green+','+blue+')';">

    Also, what's up with "selector"? Was Skeletor not available?

  4. #3
    JR
    JR is offline
    Senior Member JR's Avatar
    Join Date
    Nov 2002
    Location
    UK
    Posts
    4,354
    Member #
    257
    hmm, that wouldn't work because the red, green and blue variables are in the function. I will try to see if I can get it working, it is pretty important because it is for part of my contest entry.
    JR


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 08:50 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2020 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com