DOM Javascript | Sololearn: Learn to code for FREE!


DOM Javascript

How can I get the value of this button in javascript? 👉 <button type="button" id="btn3" value="3" onclick="3">3</button>

4/10/2021 3:29:51 PM

Raidel González Cabrera

7 Answers

New Answer


With its id.


myBtn3 = getElementById("btn3"); For more please save your code on SL Playground and provide a link here.


Raidel González Cabrera this can be done for example like here:


I'm trying to do a calculator. Help plz