SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    doRighteousDeeds++
    Join Date
    Aug 2006
    Location
    تركيا Turkey Türkiye
    Posts
    266
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    location.href=this.parentNode.href

    My code:
    Code:
    <html>
    <head>
    <meta content="text/html; charset=UTF-8" http-equiv="content-type">
    
    <style type="text/css">
    .myclass { font-family:Arial; color:blue; background-color:lime; border:2px solid red; width:100px; padding:4px; text-align:center;}
    input { font-family:Verdana; color:white; background-color:blue; border:2px solid orange; width:100px; padding:4px; text-align:center;}
    a { text-decoration:none;}
    </style>
    </head>
    <body>
    
    <br>
    <input type="button" value="google" onclick="window.open('http://www.google.com.tr') ">
    <br>
    <a href="http://www.google.com.tr" target="_blank" class="myclass">google</a>
    <br>
    <a href="http://www.google.com.tr" target="_blank"><input type="button" value="google" onclick="location.href=this.parentNode.href"></a>
    <br>
    <a href="http://www.google.com.tr" target="_blank"><input type="button" value="google" onclick="window.open(this.parentNode.href)"></a>
    
    </body>
    </html>
    I will use location.href. When I pressed button, link will be opened in new window.
    I don't want that link opens same window.
    Is it possible. Thanks...
    Last edited by muazzez; Mar 15, 2007 at 14:16.
    The Time Through Ages. In the Name of Allah, Most Gracious, Most Merciful.
    1. By the Time, 2. Verily Man is in loss,
    3. Except such as have Faith, and do righteous deeds, and (join together) in the mutual enjoining of Truth, and of Patience and Constancy.

  2. #2
    SitePoint Wizard
    Join Date
    Nov 2004
    Location
    Nelson BC
    Posts
    2,310
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    onclick="this.parentNode.click();"


Bookmarks

Posting Permissions

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