Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    Regular Coder
    Join Date
    Aug 2004
    Posts
    280
    Thanks
    0
    Thanked 0 Times in 0 Posts

    <label for problem - not working with images

    i would like to trigger the same link from few different places in a page.
    so, i give an ID to that link <a href="go.htm" id="idgo">go, baby</a>
    if a link is textual, then it is no problem:


    but, what if i want to use an image to trigger that link?
    <label for="idgo"><img src="pic.gif"></label> //this is not working

  • #2
    Senior Coder
    Join Date
    Dec 2004
    Location
    Essex, UK
    Posts
    2,636
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I don't understand... to make an image a link you need it within anchor tags...

    <a href="go.htm" id="idgo"><img src="pic.gif"></a>

    Perhaps you could provide a link so we can understand the problem better.

  • #3
    Regular Coder
    Join Date
    Apr 2004
    Location
    Birmingham, MI
    Posts
    131
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Labels are for form elements only (<input>,<select>,...). Internet Explorer's behaivor is incorrect!

  • #4
    Regular Coder
    Join Date
    Aug 2004
    Posts
    280
    Thanks
    0
    Thanked 0 Times in 0 Posts
    so it is firefox's...

    my idea is simply, that if i have one link, i have to change one link. all others just refers to that link. like i'd call an javascript, just more compatible.

    this is my link
    <a href="mylink.htm" id="lnk">link</a>

    and from few different places from the page i just refer to it with

    <label for="lnk">llllll</label> -if i click that 'lllll' text, that link is executed.

    or is it another tag, doing the same effect?

  • #5
    Senior Coder
    Join Date
    Jul 2005
    Location
    UK
    Posts
    1,051
    Thanks
    6
    Thanked 13 Times in 13 Posts
    I don't see what the point is, why not just duplicate the link normally?

  • #6
    Senior Coder
    Join Date
    Nov 2003
    Location
    Minneapolis, MN
    Posts
    2,879
    Thanks
    2
    Thanked 65 Times in 56 Posts
    Quote Originally Posted by looka
    this is my link
    <a href="mylink.htm" id="lnk">link</a>

    and from few different places from the page i just refer to it with

    <label for="lnk">llllll</label> -if i click that 'lllll' text, that link is executed.

    or is it another tag, doing the same effect?
    You're thinking along the wrong lines… HTML is a mark-up language. <a> surrounds a link, <label> denotes a label on a form element. To assign a link as a type of variable you need to use some sort of scripting. If you want total browser compatibility, use PHP or some sort of server-side scripting.

  • #7
    Regular Coder
    Join Date
    Aug 2004
    Posts
    280
    Thanks
    0
    Thanked 0 Times in 0 Posts
    okay... i give up

    thnx!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •