1. Question: You have created an object. How would you add a property to the object class?

    A
    With the prototype() method

    B
    With the prototype property

    C
    It cannot be done

    D
    With the this objec

    Note: Not available
    1. Report
  2. Question: What is the difference between calling a JavaScript function directly like onclick = "a()" and onclick="JavaScript:a()" where a() is a function written in JavaScript?

    A
    There is no difference

    B
    The first technique is correct, only the second is incorrect

    C
    The second statement is more efficient than the first

    D
    The first statement looks for a function a() written in any language, whether it is JavaScript or vbscript, and the second technique looks for a function a() specifically written in JavaScript

    Note: Not available
    1. Report
  3. Question: How would you double the size of an image on a mouseover event, if the original width and height are both 100px and the id of the image is 'logo'?

    A
    document.getElementById('logo').style.width="200" document.getElementById('logo').style.height="200"

    B
    document.getElementById('logo').style.width="100" document.getElementById('logo').style.height="100"

    C
    document.getElementById('logo').width="200" document.getElementById('logo').height="200"

    D
    document.getElementById('logo').width="100" document.getElementById('logo').height="100"

    Note: Not available
    1. Report
  4. Question: How would you test whether a browser window is still open?

    A
    Use the isOpen method of the window object reference variable

    B
    It is not possible to test whether an instance of the browser window is open

    C
    Use the closed property of the window object to test whether the window is open

    D
    Use the open method of the document object

    Note: Not available
    1. Report
  5. Question: You do not want the end user to see the JavaScript code embedded in the HTML file when the user views the source of the HTML page. How would you achieve this?

    A
    This is not possible

    B
    Use externally linked files which hold the JavaScript code

    C
    Modify the headers of the page

    D
    Change the MIME type of the page

    Note: Not available
    1. Report
  6. Question: When does the load event of the browser occur?

    A
    aWhen the browser receives header information

    B
    When the browser starts displaying the content

    C
    When the browser receives all the page information, including framesets

    D
    When the browser receives all the page information, including framesets and displays it

    Note: Not available
    1. Report
  7. Question: You are writing a JavaScript function that will accept user input. Which of the following will you use?

    A
    The prompt method

    B
    The alert method

    C
    A form field

    D
    All of the above

    Note: Not available
    1. Report
  8. Question: You want to validate the value in a field as soon as the user moves out of the field by pressing the tab key. Which event would you use?

    A
    onblur

    B
    onfocus

    C
    lostfocus

    D
    gotfocus

    Note: Not available
    1. Report
  9. Question: A form contains two fields named id1 and id2. How can you copy the value of the id2 field to id1?

    A
    document.forms[0].id1.value=document.forms[0].id2.value

    B
    document.forms[0].id2.value=document.forms[0].id1.value

    C
    document.id1.value=document.id2.value

    D
    document.id2.value=document.id1.value

    Note: Not available
    1. Report
  10. Question: Consider an HTML form with a checkbox and a text field. When data is entered and the return key is pressed, the data seems to be lost before the user can click on the button that calls the processing function. How do you correct this?

    A
    Add a TYPE=HIDDEN INPUT to the form

    B
    Trap the return keypress and return (null)

    C
    Add 'return false' to onsubmit="..." in the FORM tag

    D
    Instruct the user not to press the Return key

    Note: Not available
    1. Report
Copyright © 2025. Powered by Intellect Software Ltd