0
Access to button
Hi friends does anybody know how can I access to a clicked button in its onclick function in js?
1 Odpowiedź
+ 1
maryam mirzapoor take a look at this code as it should help
<button onclick="myFunction()">Random No. with Float</button>
<p id="wflt"></p>
<script>
function myFunction() {
document.getElementById("wflt").innerHTML = Math.random()*101;
}
</script>
https://code.sololearn.com/WIVogKcpIpT8/?ref=app