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 3 of 3
  1. #1
    New Coder
    Join Date
    Nov 2010
    Posts
    50
    Thanks
    16
    Thanked 0 Times in 0 Posts

    This "_target" is not working and I can't see why?

    This code works well, the value of "Val" is a web address but I want it to open to a new window or tab.

    Cheers Daniel.

    Code:
    document.getElementById('SelectedResult').innerHTML="<font size=2><a Href=" + Val + "target='_blank'>" + Val + "</a>"
    Last edited by DanielHowden; 12-22-2010 at 02:29 PM.

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,917
    Thanks
    203
    Thanked 2,531 Times in 2,509 Posts
    You must include a space in front of target:-

    Code:
    document.getElementById('SelectedResult').innerHTML="<font size=2><a href=" + Val + " target='_blank'>" + Val + "</a>"
    Otherwise the link is


    All advice is supplied packaged by intellectual weight, and not by volume. Contents may settle slightly in transit.

  • Users who have thanked Philip M for this post:

    DanielHowden (12-22-2010)

  • #3
    New Coder
    Join Date
    Nov 2010
    Posts
    50
    Thanks
    16
    Thanked 0 Times in 0 Posts
    Thank you, that is very helpful.

    Daniel.


  •  

    Posting Permissions

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