How do I add target=“_blank” to a link within a specified div?

前端 未结 7 1626
失恋的感觉
失恋的感觉 2020-11-27 03:29

Let\'s say I have the following code:


      
7条回答
  •  执念已碎
    2020-11-27 03:41

    Using jQuery:

     $('#link_other a').each(function(){
      $(this).attr('target', '_BLANK');
     });
    

提交回复
热议问题