Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Prototype.js shortcut for getting value of an element?

I didn't use Prototype.js before, when I use jquery, I can get an element value like $("#inputA").val(); Is there an equivalent method in prototype like this? I use $("inputA").getAttribute('value');, which is very verbose.

like image 507
Sawyer Avatar asked Dec 05 '25 21:12

Sawyer


2 Answers

document.getElementById("inputA").value is like magic: it works in EVERY framework.

like image 197
Tim Down Avatar answered Dec 07 '25 10:12

Tim Down


use getValue or $F(element) construct

like image 33
Marek Karbarz Avatar answered Dec 07 '25 09:12

Marek Karbarz



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!