JSFiddle - React, Tailwind, and code Playground
HTML
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://code.jquery.com/jquery-2.2.4.min.js"></script>
<a class="btn btn-primary" id="randomize">
Click me
</a>
<div id="question">
</div>
JavaScript
$(document).ready(function() {
var sources = new Array()
sources[0] = 'url0'
sources[1] = 'url1'
sources[2] = 'url2'
sources[3] = 'url3'
var p = sources.length;
$('#randomize').click(function() {
var randomSource = Math.round(Math.random()*(p-1));
$("#question").text("URL value is now: " + sources[randomSource]);
$('#question').attr('src', sources[randomSource]);
});
});