I have tried console logging the button that I am clicking with the $(this)
selector but it just does not want to log to the console and when it logs, it's empty.
$(document).ready(function(){
$('.button').on('click', ()=>{
var clickedBtn = $(this).children(":first").text();
console.log(clickedBtn);
})
})
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div class="content">
<div class=" title welcome-msg-head level-left">
<p>Welcome to the personality test!</p>
</div>
<div class="q-block">
<div class="opacity">
<h1 style="color: black;">How old is rick?</h1>
<button id="69" class="button" value="69"><p>69</p></button>
<button id="103" class="button" value="103"><p>103</p></button>
<button id="45" class="button" value="45"><p>45</p></button>
<button id="70" class="button" value="70"><p>70</p></button>
</div>
<progress class="is-primary progress" value="0.25"/>
</div>
</div>