0% found this document useful (0 votes)
7 views3 pages

JS DOM To BuiltInObjects

The document covers key concepts in JavaScript including the Document Object Model (DOM) for manipulating HTML, form validation techniques, and the use of regular expressions for pattern matching. It also discusses DHTML for creating dynamic web pages, the Date object for handling time, and various built-in objects in JavaScript. Examples are provided for each concept to illustrate their usage.

Uploaded by

gantachakriroyal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views3 pages

JS DOM To BuiltInObjects

The document covers key concepts in JavaScript including the Document Object Model (DOM) for manipulating HTML, form validation techniques, and the use of regular expressions for pattern matching. It also discusses DHTML for creating dynamic web pages, the Date object for handling time, and various built-in objects in JavaScript. Examples are provided for each concept to illustrate their usage.

Uploaded by

gantachakriroyal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

1.

Document Object Model (DOM)

- DOM represents the structure of a web page as a tree of objects.

- JavaScript can access and manipulate HTML elements using the DOM.

Example:

[Link]("demo").innerHTML = "Hello DOM";

2. Form Validation

- Ensures the user provides valid input in HTML forms before submitting.

- JavaScript is commonly used for client-side validation.

Example:

function validateForm() {

let x = [Link]["myForm"]["fname"].value;

if (x == "") {

alert("Name must be filled out");

return false;

3. Regular Expressions

- Used to match patterns in strings.

- Often used for validation (email, phone, etc).

Example:
let pattern = /^[a-z0-9]+@[a-z]+\.[a-z]{2,3}$/;

let result = [Link]("test@[Link]");

4. DHTML with JavaScript

- DHTML = HTML + CSS + JavaScript + DOM.

- Used to create dynamic and interactive web pages.

Example:

<button onclick="showMessage()">Click Me</button>

<script>

function showMessage() {

[Link]("msg").innerHTML = "Hello DHTML!";

</script>

5. Date & Object

- Date Object: Used to handle date and time.

- Object: Collection of key-value pairs.

Example:

let now = new Date();

[Link]([Link]());

let person = { name: "Alice", age: 25 };

6. Built-in Objects
- JavaScript provides many built-in objects for common tasks.

Examples:

String, Number, Boolean, Array, Math, Date, RegExp, Object, JSON, Error

Example:

let str = "Hello";

[Link]([Link]());

let nums = [1, 2, 3];

[Link]([Link]);

You might also like