开发者

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;

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜