I have a number buttons which when pressed open a modal with an iframe. The buttons have data attributes that store the link which I want to pass to the iframe scr.
This is the code for the buttons:
<a href="#myModal" style="float: right;" class="btn btn-outline-secondary" data-toggle="modal" data-jobid="index.php?/job/view/1" ><strong>View</strong></a>
<a href="#myModal" style="float: right;" class="btn btn-outline-secondary" data-toggle="modal" data-jobid="index.php?/job/view/2" ><strong>View</strong></a>
<a href="#myModal" style="float: right;" class="btn btn-outline-secondary" data-toggle="modal" data-jobid="index.php?/job/view/3" ><strong>View</strong></a>
This is the code for the iframe:
<iframe style="display: block; width: 100%; height: 100%; border: none;" src=""></iframe>
My question is how can I pass the data-jobid to the src of the iframe each time one of the buttons is clicked?