Get the content inside div

say i have the following div
<div class = "button">420</div>
<div class = "button">420</div>
like for inputs, in js u can get the value using input.vlaue how can I get the value or content of the div which is 420?? i see values don't work for divs
13 Replies
Mannix
Mannix15mo ago
textContent/innerText ?
glutonium
glutonium15mo ago
yaa i searched on gpt and it told me the same tnx ❤️ btw, the value will be a string if I'm not wrong ryt?
Mannix
Mannix15mo ago
probably 🙂
glutonium
glutonium15mo ago
ok tnx
b1mind
b1mind15mo ago
Div class button..... <Button> ....
Jochem
Jochem15mo ago
yeah, don't use divs as buttons, it's terrible for accessibility.
b1mind
b1mind15mo ago
they left the thread... @ʙᴏᴏʙ 2.0 ☝️
Jochem
Jochem15mo ago
lol
b1mind
b1mind15mo ago
>.>;; pulling back in cause of the importance of this lession divs, a != buttons!
vince
vince15mo ago
I was thinking the same thing 😳
glutonium
glutonium15mo ago
which thread ;-; i was making a calculator and I just used divs for the buttons xD ahaha ok sure
Jochem
Jochem15mo ago
just... don't use buttons for buttons
glutonium
glutonium15mo ago
sure I won't xD