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

What attribute makes the input text box to not be modified by the user?
checked="checked" readonly="readonly" disabled="disabled"
<input type="text" value="fixed-value" readonly="readonly" name="a_name" />
What CSS property allows you to create rounded corners in your webpage design?
background-size border-size border-radius
.class {
  border:2px solid blue;
What instruction displays a confirmation dialog box to the viewer, who must then click OK or Cancel to proceed?
indexOf() confirm() prompt()
var ques = window.confirm("The result of 0+0 is 0?");
if (ques) alert("Corect");
else alert("Incorrect");
Indicate the PHP function that returns the lowest number of the parameter values.
floor() ceil() min()
$min_nr = min(12, 8, 25, 13);
echo $min_nr;        // 8
Accessing form fields

Last accessed pages

  1. PHP MySQL - WHERE and LIKE (27759)
  2. SHA1 Encrypt data in JavaScript (27900)
  3. PHP PDO - Select query, fetch (27656)
  4. CSS Rhombus Shape (6171)
  5. Ajax click Tracking - Monitor clicks on html elements (1747)

Popular pages this month

  1. PHP Unzipper - Extract Zip, Rar Archives (96)
  2. Courses Web: PHP-MySQL JavaScript Node.js Ajax HTML CSS (58)
  3. JavaScript Course - Free lessons (45)
  4. SHA1 Encrypt data in JavaScript (45)
  5. Read Excel file data in PHP - PhpExcelReader (40)