JSFiddle - React, Tailwind, and code Playground

by sarathsprakash

HTML

<map name="rockpos" id="rockys">
    <area shape="rect" id="first" coords="1,1,137,270" href="" />
    <area shape="rect" id="second" coords="208,4,340,273" href="" />
</map>

JavaScript

var choose = Math.floor((Math.random() * 4) + 1);


if (choose == 1) {
    $('#first').attr('href', 'true.html');
    $('#second').attr('href', 'false.html');
} else {
    $('#first').attr('href', 'false.html');
    $('#second').attr('href', 'true.html');
}
alert($('#first').attr('href')+","+  $('#second').attr('href') )