1. Question: Which of the following is not a JavaScript string method?

    A
    rep

    B
    split

    C
    substr

    D
    slice

    Note: Not available
    1. Report
  2. Question: Consider the following JavaScript alert:
    <script type="text/JavaScript">
    function message(){
      alert("Welcome to ExpertRating!!!")
    }
    </script>
    You want the user to see the above message upon opening the page. How will you implement this?

    A
    <body onload="message()">

    B
    <body onunload="message()">

    C
    <body onsubmit="message()">

    D
    <body onreset="message()">

    Note: Not available
    1. Report
  3. Question: You are setting cookies with JavaScript. What happens to cookies.txt data if the file exceeds the maximum size?

    A
    Your script automatically generates a run-time error

    B
    Your script automatically generates a load-time error

    C
    All processes using document.cookie are ignored

    D
    The file is truncated to the maximum length

    Note: Not available
    1. Report
  4. Question: What does the following code snippet do? <input type="radio" name="r1" value="radio1" onclick="this.checked=false;alert('sorry')">

    A
    The code is invalid

    B
    The code makes it necessary for the user to select the radio button

    C
    The code disables the radio button

    D
    The code displays an alert when the user selects the button

    Note: Not available
    1. Report
  5. Question: How would you declare a global variable in your JavaScript code?

    A
    All variables are local in JavaScript

    B
    You will have to declare the variable between the 'script' tags and outside a function to make the variable global

    C
    You will have to precede the variable name with the constant global

    D
    You will have to declare the variable in an external file

    Note: Not available
    1. Report
  6. 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
  7. 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
  8. 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
  9. 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
  10. 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
Copyright © 2025. Powered by Intellect Software Ltd