Friday, 21 July 2017

How to add attribute in HTML with jQuery

<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
   
        $("a").attr("target", "_blank");
   
});
</script>
</head>
<body>
<a href="http://naveenwebdesign.blogspot.in" id="nvn">Naveen web design</a>
</body>

No comments:

Post a Comment