how to isolate clicks on the background ???

Discussion in 'CSS' started by Pesho318i, Nov 20, 2007.

  1. #1
    hello,

    I have the following problem here - in my HTML I have a <li> tag, which holds other tags inside(img div-s, hyperlinks).
    My desire is to call a JavaScript function, but only when the background of <li> is clicked. For example if a link within the <li> tag is clicked, then the corresponding link is followed.

    I tried adding the function directly in the <li onclick="testFunction();"> but then it executes no matter what I click within this tag.


    Please let me know if it's possible to isolate only the background clicks.

    Thanks!
     
    Pesho318i, Nov 20, 2007 IP
  2. Crimsonc

    Crimsonc Peon

    Messages:
    616
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    0
    #2
    if you have a link inside a li tell it to display as a block and have that with a unique identifier then define that in your javascript. Thats if i understand you correctly.
     
    Crimsonc, Nov 21, 2007 IP