Changing link attribute by jquery


/ Published in: jQuery
Save to your folder(s)



Copy this code and paste it in your HTML
  1. <script type="text/javascript">
  2. // document ready
  3. $(document).ready(function(){
  4.  
  5. //change the target attribute to open in different tab
  6. //on the class texto, selector a
  7. $(".texto a").attr('target', '_blank');
  8. });
  9.  
  10. // @authors Lucas Koetz & Andre Luis
  11. // @country Brazil
  12.  
  13. </script>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.