1. Question: Consider the following code snippet:
    <form name="frmOne">
    <select name="selList" size="1" onChange="change()">
    <option value="http://www.hotmail.com">tHomail</option>
    <option value="http://www.yahoo.com">Yahoo</option>
    </select>
    </form>
    You want that when an option button is selected, the appropriate website should be opened immediately. What will the change() function look like?

    A
    url=document.frmOne.selList.options[document.frmOne.selList..item].value

    B
    url=document.frmOne.selList.options[document.frmOne.selList.selectedIndex].value

    C
    location=document.frmOne.selList.options[document.frmOne.selList.item].value.value

    D
    location=document.frmOne.selList.options[document.frmOne.selList.selectedIndex].value

    Note: Not available
    1. Report
  2. Question: How would you detect the operating system of the client machine?

    A
    It is not possible using JavaScript

    B
    You would use the navigator object

    C
    You would use the window object

    D
    You would use the document object

    E
    None of the above

    Note: Not available
    1. Report
  3. Question: What would be the use of the following code?
    function validate(field)
    {
    var valid=''ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'';
    var ok=''yes'';
    var temp; 
    for(var i=0;i<field.value.length;i++)
    {
    temp='''' + field.value.substring(i,i+1)
    if(valid.indexOf(temp)==''-1'')
    {
    ok=''no'';
    }
    } 
    if(ok==''no'')
    {
    alert(''error'');
    field.focus();
    } 
    }

    A
    It will force a user to enter only numeric values

    B
    It will force a user to enter only alphanumeric values

    C
    It will force a user to enter only character values

    D
    None of the above

    Note: Not available
    1. Report
  4. Question: Consider the following code: var vNew=new Date() Which of the following options will return true?

    A
    vNew instanceof boolean

    B
    vNew instanceof object

    C
    vNew instanceof Date

    D
    All of the above

    Note: Not available
    1. Report
  5. Question: Which of the following escape sequences represents form feed?

    A
    //f

    B
    'f'

    C
    /f

    D
    \f

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