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
Mannix2y ago
textContent/innerText ?
glutonium
glutoniumOP2y 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
Mannix2y ago
probably 🙂
glutonium
glutoniumOP2y ago
ok tnx
b1mind
b1mind2y ago
Div class button..... <Button> ....
Jochem
Jochem2y ago
yeah, don't use divs as buttons, it's terrible for accessibility.
b1mind
b1mind2y ago
they left the thread... @ʙᴏᴏʙ 2.0 ☝️
Jochem
Jochem2y ago
lol
b1mind
b1mind2y ago
>.>;; pulling back in cause of the importance of this lession divs, a != buttons!
vince
vince2y ago
I was thinking the same thing 😳
glutonium
glutoniumOP2y ago
which thread ;-; i was making a calculator and I just used divs for the buttons xD ahaha ok sure
Jochem
Jochem2y ago
just... don't use buttons for buttons
glutonium
glutoniumOP2y ago
sure I won't xD
Want results from more Discord servers?
Add your server