Change the target attribute of a link : Hyper Link : HTML JAVASCRIPT DHTML TUTORIALS


JAVASCRIPT DHTML TUTORIALS » HTML » Hyper Link »

 

Change the target attribute of a link



<html>

<head>
<script type="text/javascript">
function myTarget(){
    document.getElementById('myAnchor').target="_blank"
}
</script>
</head>

<body>
    <a id="myAnchor" href="http://www.navioo.com">Visit navioo</a>
    <form>
        <input type="button" onclick="myTarget()" value="Make the link open in a new window!">
    </form>
    <p>Try the link before and after you have pressed the button!</p>
</body>

</html>


           
       



-

Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .

Follow Navioo On Twitter

JAVASCRIPT DHTML TUTORIALS

 Navioo HTML
» Hyper Link