views:

65

answers:

4

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.

A: 

$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.

Pointy
+2  A: 

use getValue or $F(element) construct

Marek Karbarz
Does prototype has a jquery like wrapper object? what does $F("inputA"); return ?
ZZcat
"Returns the current value of a form control. A string is returned for most controls; only multiple select boxes return an array of values. The global shortcut for this method is $F()."
Marek Karbarz
A: 

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

Tim Down
A: 

var x = $('inputA').value;