1. Question:What is JavaScript Events and events handler? 

    Answer
    1. Events are actions that can be detected by JavaScript.
    2. Every element on a web page has certain events which can trigger a JavaScript.
    3. Events are normally used in combination with functions.

    Examples of events: -Clicking a button (or any other HTML element)
    -A page is finished loading
    -An image is finished loading
    -Moving the mouse-cursor over an element
    -Entering an input field
    -Submitting a form
    -A keystroke

    Event handler: Event handlers are the way JavaScript deals with events. JavaScript contains a variety of event handlers for various purposes.
    Example of some event handlers are: onclick, onload, onkeypress, onmouseover etc.






    1. Report
  2. Question:

    What do you mean by Array? How will you declare an array?

     

    Answer
    Array
    1. Array is a compound data structure in computing.
    2. It is as a collection of numbered variable.

    An array in javaScript have the following general syntax to declare:

    1. var a=new Array();
    2. var a=[];







    1. Report
  3. Question:What is the difference between “==” and “===” operator? 

    Answer

    1. Both are comparison operators but
    2. "==" test for equally operator compares its operands with only value ignoring the datatype.
    3. Whereas "===" test for strict equally operator compares its operands with datatypes and the value.






    1. Report
  4. Question:What do you mean by “with” statements? Write it’s syntax. 

    Answer

    With statement:


    1. JavaScript’s with statement was intended to provide a shorthand for writing recurring accesses to objects.
    2. Instead of having to list all of the properties of an object by repeating the basic object, we can state the bulk of the object in a with statement and then the properties within the context of the with statment.

    Syntax:
    with (object){
      statement
    }

    Example:
    var a, x, y;
    var r = 10;
    with (Math) {
      a = PI * r * r;
      x = r * cos(PI);
      y = r * sin(PI / 2);
    }






    1. Report
  5. Question:What do you mean by DOM? Write its properties. 

    Answer

    The Document Object Model (DOM) is a cross-platform and language-independent convention for representing and interacting with objects in HTML, XHTML and XML documents.

    Some of Document Properties:
    a. AlinkColor
    b. Anchors[array]
    c. BgColor
    d. Cookie
    e. Domain
    g. Forms[array]
    h. Images[array]
    i. LinkColor
    j. Links[array]
    k. Location
    l. Title






    1. Report
Copyright © 2025. Powered by Intellect Software Ltd