JSFiddle - React, Tailwind, and code Playground

HTML

<div style="display:none" id="content1">This displays for link1</div>
   <div style="display:none" id="content2">This displays for link2</div>

   <a class="windowlink" rel="content1" href="#">Link 1</a><br>
   <a class="windowlink" rel="content2" href="#">Link 2</a>

JavaScript

$('.windowlink').click(function() {


var hrefvalue = $('#' + $(this).attr('href')).html();


       var html = $('#' + $(this).attr('rel')).html();
         alert(hrefvalue);
       var newwindow = open('');
       newwindow.document.write(html);
       newwindow.document.close();
     });