1. Question: How would you randomly choose an element from an array named myStuff if the number of elements changes dynamically?

    A
    randomElement = myStuff[Math.floor(Math.random() * myStuff.length)];

    B
    randomElement = myStuff[Math.ceil(Math.random() * myStuff.length)];

    C
    randomElement = myStuff[Math.random(myStuff.length)];

    D
    randomElement = Math.random(myStuff.length);

    Note: Not available
    1. Report
  2. Question: Which of the following declarations is not valid?

    A
    var a var b var c

    B
    var a, b, c

    C
    var a=10, b=20, c=30

    D
    All are valid

    Note: Not available
    1. Report
  3. Question: How will you change the color of all the paragraph text to blue when the mouse is placed over paragraph, and reset it back when the mouse leaves?

    A
    <p onmouseover="style.color='black'" onmouseout="style.color='blue'"> The text of the paragraph..</p>

    B
    <p onmouseover="style.color='blue'" onmouseout="style.color='black'"> The text of the paragraph..</p>

    C
    <p onmouseout="style.color='blue'"> The text of the paragraph..</p>

    D
    <p onmouseover="style.color='blue'"> The text of the paragraph..</p>

    Note: Not available
    1. Report
  4. Question: Which property would you use to redirect a visitor to another page?

    A
    document.URL

    B
    window.location.href

    C
    document.location.href

    D
    link.href

    Note: Not available
    1. Report
  5. Question: What will the following code snippet do? onMove="window.status='come on in!'"

    A
    It displays the message 'come on in!' when the user moves the mouse over the document

    B
    It displays the message 'come on in!' when the user clicks the mouse on the document

    C
    It displays the message 'come on in!' when the user moves the window

    D
    None of the above

    Note: Not available
    1. Report
  6. Question: Consider the three variables: someText = 'JavaScript1.2'; pattern = /(\w+)(\d)\.(\d)/i; outCome = pattern.exec(someText); What does outCome[0] contain?

    A
    true

    B
    false

    C
    JavaScript1.2

    D
    null

    Note: Not available
    1. Report
  7. Question: You want to keep track of when the user highlights text within a text or textarea object. Which event would you use?

    A
    onSelect

    B
    onBlur

    C
    onChange

    D
    onMove

    Note: Not available
    1. Report
  8. Question: How would you check whether the variable vRast exists or not?

    A
    if (typeof vRast="undefined") {}

    B
    if (typeof vRast =="undefined") {}

    C
    if (vRast.defined =true) {}

    D
    if (vRast.defined ==true) {}

    Note: Not available
    1. Report
  9. Question: Which of the following shortcuts can be used for writing multiple document.write statements?

    A
    for(document){}

    B
    with(document) {}

    C
    This(document){}

    D
    None of the above

    Note: Not available
    1. Report
  10. Question: Given the following window.open function: window.open(url,name,"attributes") How will you ensure that different urls are opened in the same window?

    A
    The second attribute, name should be the same

    B
    The name attribute should be null

    C
    The name attribute should be omitted

    D
    The name attribute should be different

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