how can i make this work?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Cool Mentalist

    how can i make this work?

    function lightUp(light){

    light.style.bac kground="yellow "
    }

    [a onclick="lightU p(id of a td)"] hello [/a]
    [a onclick="lightU p(id of a different td)"] hello2 [/a]
    [a onclick="lightU p(id of a yet another td)"] hello3 [/a]
    etc etc

    how can i make this work?
  • Lasse Reichstein Nielsen

    #2
    Re: how can i make this work?

    coolmentalist@a ol.com (Cool Mentalist) writes:
    [color=blue]
    > function lightUp(light){[/color]

    document.getEle mentById(light) .style.backgrou ndColor="yellow ";
    [color=blue]
    > }
    >
    > [a onclick="lightU p(id of a td)"] hello [/a][/color]

    <a ... onclick="lightu p('tdId')"> hello </a>
    [color=blue]
    > how can i make this work?[/color]

    I guess it could work as written ... in some browsers, that is, if I
    knew what you had really written, and how you wanted it to work.

    /L
    --
    Lasse Reichstein Nielsen - lrn@hotpop.com
    Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit. html>
    'Faith without judgement merely degrades the spirit divine.'

    Comment

    • Gavino Paolini

      #3
      Re: how can i make this work?

      Look at the bottom, hope it works!

      On Wed, 06 Aug 2003 16:33:42 +0000, Cool Mentalist wrote:
      [color=blue]
      > function lightUp(light){
      >
      > light.style.bac kground="yellow "
      > }
      >
      > [a onclick="lightU p(id of a td)"] hello [/a]
      > [a onclick="lightU p(id of a different td)"] hello2 [/a]
      > [a onclick="lightU p(id of a yet another td)"] hello3 [/a]
      > etc etc
      >
      > how can i make this work?[/color]
      Try this:

      <html>
      <head>
      <title>Illustra tion</title>
      <script type="text/javascript">
      function lightUp(light){
      var elem=document.g etElementById(l ight);
      elem.style.back ground="yellow" ;
      }
      </script>
      </head>
      <body>
      <p id="p1" onClick="lightU p('p1');">ciao</p>
      <a id="a1" href="../xxx.html" onClick="lightU p('a1');">ciao</a>
      </body>
      </html>


      Comment

      • Cool Mentalist

        #4
        Re: how can i make this work?

        thanks I'm grateful

        Comment

        Working...