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.
document.getElementById("inputA").value
is like magic: it works in EVERY framework.
use getValue
or $F(element)
construct
$F('elementId')
is one way. That's problematic for radio buttons. I haven't used Prototype in a while however so maybe there's something new.
var x = $('inputA').value;
精彩评论