JSFiddle - React, Tailwind, and code Playground
by Md. Atiquzzaman Soikat
HTML
<section class="boxSwipe boxSwipeSingle">
<section class="boxSwipe boxSwipeSingle">
<section class="text-platinum grid-fluid l-content l-clearfix">
<div class="boxSwipeHeader">
<center>
<h4>Have You Or Someone You Love Been Harmed By Distracted Driving?</h4>
</center>
<div class="cta-bar boxSwipeContent">
<a class="button1 button-large button-blue" href="/auto-accident.php">Yes</a>
<a href="https://google.com" class="button1 button-large hideClick">No</a>
</div>
</div>
<p class="customText">this is test</p>
</section>
</section>
</section>
JavaScript
$(document).ready(function(){
$(".customText").hide();
$(".hideClick").click(function(e){
e.preventDefault();
console.dir(e.target);
if(e.target.href.length > 0){
console.log(e.target.href);
window.location = e.target.href;
}else{
$(".customText").show();
$(".boxSwipeContent").hide();
}
});
});