javascript features

features :

  • case sensitive
  • dynamically typed
  • cross-platform
  • interpreted
  • interpretd
  • object-oriented scripting language
  • backward compatitble

Objects in JavaScript:

DOM objects are the objects in JavaScript that represent HTML elements in the web page. Each element in an HTML document is represented by a unique DOM object that can be manipulated using JavaScript

Element object: This represents an HTML element and provides methods for manipulating its properties and attributes. For example, the following code selects an image element and changes its source attribute:

Node object: This represents a node in the DOM tree and provides methods for navigating the tree and manipulating its contents. For example, the following code selects a parent node and adds a new child node:

document object: This represents the entire web page and provides methods for selecting and manipulating elements within the page. For example, the following code selects an element with the ID “myDiv” and changes its background color to red:

boolean data type in javascript:

boolean: it can hold only two values true and false.

for example: var read=true; var eat=false:

Comparison Operators: Comparison operators in JavaScript return boolean values.

For example:

Logical Operators: Logical operators like && (AND), || (OR), and ! (NOT) also work with boolean values:

for example:

Boolean Functions: Functions can also return boolean values.

For instance:

Leave a Reply

Your email address will not be published. Required fields are marked *