Javascript Course

There are many types of HTML form elements for different types of data that can be added or selected by the user.
- See the HTML tutorials: Forms and Input, and New Form elements and attributes in HTML5.

Accessing elements of <form> in JavaScript

There are several ways to access elements of a <form> in JavaScript.
Generally, these methods are used: getElementById(), querySelector(), the syntax: eform['elm_name'], or the eform.elements[index] property.

Forms elements have specific properties and methods that can be used in JavaScript to interact with the user.
- There is a list with useful properties and methods of the elements from <form> at the page:

Daily Test with Code Example

Which type of <input> creates input fields that should contain a numeric value?
type="text" type="number" type="date"
<input type="number" name="points" min="5" max="80" />
Which CSS property allows to change the transparency of an element?
font-style opacity color
#id {
  filter:alpha(opacity=40);    /* for IE */
Click on the function that formats a number to specified number of characters.
toPrecision() exp() toFixed()
var num = 12.34567;
alert( num.toPrecision(3) );       // 12.3
Which function randomizes the order of the elements into an array?
natsort() shuffle() sort()
$lang =[10=>"PHP", 20=>"JavaScript", "site"=>"");
var_export($lang);     // array (0=>"", 1=>"PHP", 2=>"JavaScript")
Accessing form fields

Last accessed pages

  1. PHP Script Website Mini-Traffic (5099)
  2. Bind Tool and Control Points (3457)
  3. Convert BBCode to HTML and HTML to BBCode with JavaScript (6640)
  4. EasyPhpThumbnail Class (1494)
  5. Ajax-PHP Chat Script (45256)

Popular pages this month

  1. Courses Web: PHP-MySQL JavaScript Node.js Ajax HTML CSS (233)
  2. PHP-MySQL free course, online tutorials PHP MySQL code (158)
  3. Read Excel file data in PHP - PhpExcelReader (147)
  4. querySelector and querySelectorAll (105)
  5. Wake Up! (101)