The Global object has properties and methods at the highest level, without a parent object. This means that global properties and functions can be used with all the built-in JavaScript objects.


• The Global object has three properties:
Global object methods (or functions):
- In the following example is a JS script that uses the method eval() twice, transform and interpret the argument received as a JavaScript code.
<script type="text/javascript"><!--
function calcs(form) {
  form.re.value = eval(form.expr.value);
}
eval("alert('Have a good life!')");
--></script>
<form>
 <p>Enter a mathematical expression (addition, subtraction, multiplication, division), for example (7*8 or 3+8/2): </p>
 <input type="text" name="expr" size="35" />
 <input type="button" name="calc" value="Calculation" onclick="calcs(this.form)" /><br />
 The result is:
 <input type="text" name="re" size="18">
</form>
- This code displays an alert window and then the following result. A form that you can use for simple math operations:

Enter a mathematical expression (addition, subtraction, multiplication, division), for example (7*8 or 3+8/2):


The result is:

Daily Test with Code Example

HTML
CSS
JavaScript
PHP-MySQL
Which tag adds a new line into a paragraph?
<b> <br> <p>
First line ...<br>
Other line...
Which CSS property can be used to add space between letters?
text-size word-spacing letter-spacing
#id {
  letter-spacing: 2px;
}
What JavaScript function can be used to get access to HTML element with a specified ID?
getElementById() getElementsByTagName() createElement()
var elm = document.getElementById("theID");
var content = elm.innerHTML;
alert(content);
Click on the "echo" correct instruction.
echo "CoursesWeb.net" echo "CoursesWeb.net"; echo ""CoursesWeb.net";
echo "Address URL: http://CoursesWeb.net";
Global Object

Last accessed pages

  1. Bubbles3 (8622)
  2. Butterfly Kyodai (6559)
  3. Lucky Balls (391)
  4. Get search data from URL address in JavaScript (1501)
  5. AJAX with POST and PHP (7442)

Top accessed pages

  1. Courses Web: PHP-MySQL JavaScript Ajax HTML CSS Flash-AS3 (47733)
  2. Read Excel file data in PHP - PhpExcelReader (35866)
  3. PHP-MySQL free course, online tutorials PHP MySQL code (35489)
  4. Get Attribute (ID, Class, Name, Title, Src) with jQuery (31998)
  5. PHP PDO - exec (INSERT, UPDATE, DELETE) MySQL (29264)