Copyright © tutorialspoint.com

Prototype $F() Method

previous next


Advertisements

The $F() function returns the value of any field input control, like text boxes or drop-down lists. This is a convenience alias of Form.Element.getValue.

The function can take as argument either the element id or the element object itself.

Syntax:

$F(element) 

Return Value:

Example:

<html>
<head>
<title>Prototype examples</title>
<script type="text/javascript" 
   src="/javascript/prototype.js">
</script>
<script>

function ShowValue(){
      var value = $F('userName');

      alert( 'Entred  Value :' + value);
}
</script>
</head>

<body>

   <p>Enter any value in the box and then click "Show Value"</p>

   <form>
   <input type="text" id="userName" value="Madisetti, Praveen">
   <br/>

   <input type="button" value="Show Value" onclick="ShowValue();"/>
   </form>

</body>
</html>

To understand it in better way you can Try it yourself.


previous next

Copyright © tutorialspoint.com