JSFiddle - React, Tailwind, and code Playground
HTML
<div class="option readmore"><a href="http://cnn.com">CNN</a></div>
<script type="text/javascript">
(function() {
var count =($('.option').length);
// "count = 1" SETS COUNT EQUAL TO 1!!!!!
if (count === 1) {
var url = $('.readmore a').first().attr('href');
window.location.replace(url);
}
else {
alert("more than 1... specificially " + count);
}
})();
</script>