DHTML Test Fiverr

While coding a loop, you come across a condition where you have to ignore the rest of the statements and continue with the beginning of the loop. Which of the following statements would you use?

exit
return
continue
while
break

After clicking on a link, your main browser window spawns a small new window and writes some text on it. When both the window page sources are viewed, the small window page source seems identical to that of the large one. Which of the following makes this happen?

The function writing to the new window did not close the document stream
Windows receive the source code of the window that wrote to them
Since the new window has no filename, it receives the source code of its parent
None of the above

Which of the following styles will be helpful in keeping an image at a fixed position on the webpage, even if someone scrolls the page?

background-style:fixed;
background-style:static;
background-attachment:fixed;
background-attachment:static;

How would you test whether or not a browser window is open?

By using the isOpen method of the window object reference variable
By using the closed property of the window object reference variable
By using the open method of the document object
None of the abov

Consider the following validate function:
<script type="text/javascript">
function ValidateField()
{
        if(document.forms[0].txtId.value =="")
                {return false;}
        return true;
}
</script>
This function should be called as soon as the user leaves the field. What will you do?

 <input name=txtId type="text" onreset="return ValidateField()">
<input name=txtId type="text" onfocus="return ValidateField()">
<input name=txtId type="text" onsubmit="return ValidateField()">
<input name=txtId type="text" onblur="return ValidateField()">

DHTML uses a combination of:

HTML
A scripting language
Cascading style sheets
All of the above

The form tag is defined as follows:
<form onsubmit="return Validate()" action="http://www.mysite.com/">
How will you implement the Validate() function that will stop the form from being submitted if the name field on the form is not filled?

 <script type="text/javascript">
function Validate()
{
if(document.forms[0].name.value == "")
        return true;
else
        return false;
}
</script>

 <script type="text/javascript">
function Validate()
{
if(document.forms[0].name.value == "")
        return false;
else
        return true;
}
</script>

 <script type="text/javascript">
function Validate()
{
if(document.forms[0].name== "")
        return false;
else
        return true;
}
</script>

 <script type="text/javascript">
function Validate()
{
if(document.forms[0].name == "")
        return true;
else
        return false;
}
</script>

Which of the following is true?

If onKeyDown returns false, the key-press event is cancelled
If onKeyPress returns false, the key-down event is cancelled
If onKeyDown returns false, the key-up event is cancelled
If onKeyPress returns false, the key-up event is cancelled

Which of the following event would execute a script once a web page has completely loaded all content?

OnLoad
OnKeyPress
OnKeyUp
onClick

You are displaying image thumbnails on a page. Upon clicking a thumbnail, the image is being displayed in its actual size. You do not want the user to be able to click the thumbnails unless they are completely downloaded. Which event will you use to prevent the user from clicking on the thumbnails until they are completely downloaded?

OnLoad
OnKeyPress
OnKeyUp
onClick

How would you reduce the image size to half of the original, on an mouseover event, if the original width and height are 100px and the id is logo?

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

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

document.getElementById('logo').width="50"
document.getElementById('logo').height="50"

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

If an image is placed styled with z-index=-1 and a text paragraph is overlapped with it. Which one will come on top?

paragraph
image
any of the above

The following statements show two ways of calling a JavaScript function:
i)onclick = "a()"
ii)onclick="javascript:a()"
a() refers to a function written in JavaScript.
Which of the following statements is correct with regard to the above two statements?

There is no difference between the two statements
The first statement is incorrect and the second one is correct

Consider the three variables:
someText = 'JavaScript1.2';
pattern = /(\w+)(\d)\.(\d)/i;
outCome = pattern.exec(someText);
What does pattern.ignoreCase contain?

true
false
undefined
null
0

How would you create a popup window that closes after n seconds?

You cannot program a window to close automatically after n seconds. The user will have to manually close it
You would use the setTimeout function
You would use the exit function of the window object
You would use the terminate function
None of the above

Which of the following properties of JavaScript is used to store the extra values for DHTML tricks?

DHTML
 HTML
innerHTML
outerHTML

The anchor tag is defined as follows:
<a href="http://expertrating.com">expertrating</a>
Which of the following styles will make convert this to capital letters on mouseover?

a:hover { text:ucase;}
a:hover { text-style:uppercase;}
a:hover { text-transform:uppercase;}
a:hover { text-style:upper;}

You have a button definition as given below:
<input class="a" type="button" value="Calculate">
To load an image "Img2.jpg" as the background of the button on a mouseover event, you can use:

event.srcElement.style.backgroundImage=”Img2.jpg”
event.srcElement.style.Image=”Img2.jpg”
event.srcElement.style.backgroundImage=”url(‘Img2.jpg’)”
event.srcElement.style.Image=”url(‘Img2.jpg’)”

Which of the following statements is incorrect with regard to a style sheet?

Style sheet defines how an HTML element will be displayed
Internal and external style sheets cannot be used together
Multiple style definitions will cascade into one
Same style sheets can be used by many HTML pages

How can you use a timer with a function called rearrange()?

tmr=setTimeout(“rearrange()”,1)
tmr=Timer(1,”rearrange()”)
tmr=Timer(“rearrange()”,1)
tmr=setTimeout(1,”rearrange()”

Which code will be useful for disabling the right click event in Internet Explorer?

event.button == 2
event.button == 4
event.click == 2
event.click == 4

Which of the following helps you create hyperlinks without an underline?

a{text-decoration:none}
a{text-decoration:noline}
a{text-decoration:hide}
a{text-decoration:invisible}
a{ font-style: normal;}
a{font-style: none;}

The width of the h4 is defined as follow:
H4 {width:95%;}
How can you make the heading blur?

<h4 filter(blur)>Heading</h42>
<h4 style=”filter:blur()”>Heading </h4>
<h4 style=”filter::blur()”>Heading </h4>
<h4 style=”Blur()”>Heading </h4>

Which of the following will you use for changing the color of a button with id=btn, to green on a mouseover event?

btn.color=”green”
document.getElementById(‘btn’).color=”green”
document.getElementById(‘btn’).style.color=”black”
document.getElementById(‘btn’).style.color=”green“

Which of the following will you use for changing the color of the textbox text with id=txtLocation to blue, on a mouseover event?

txtLocation.color=”blue”
document.getElementById(‘txtLocation’).color=”blue”
document.getElementById(‘txtLocation’).style.color=”black”
document.getElementById(‘txtLocation’).style.color=”blue”

Which of the following enables JavaScript Document Object Model to provide access to the HTTP header?

document.GetHeader()
document.getId(‘header’)
document.getElementByName(‘header’)
document.getElementById(‘header’)
You cannot read the HTTP header information using JavaScript

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. Which of the following helps you achieve this?

This is not possible
Use externally linked files which hold the JavaScript code
Modify the headers of the page
Change the MIME type of the page

Which of the following is the right way of calling them in an HTML page?

 <td class="td.right">Some Text</td>
<td class="right" class="left">Some Text</td>
<td class="td.left" class="td.right">Some Text</td>
<td class="right">Some Text</td>

You want to shake a link on the mouseover event. If the style position is set to relative and the anchor id is lnk1, which of the following code lines will be useful with a timer?

document.getElementById(‘lnk1′).left=”0″
document.getElementById(‘lnk1′).left=”2″

document.getElementById(‘lnk1′).style.left=”0″
document.getElementById(‘lnk1′).style.left=”2″

document.getElementById(‘lnk1′).style.move=”0″
document.getElementById(‘lnk1′).style.move=”2″

document.getElementById(‘lnk1′).right=”0″
document.getElementById(‘lnk1′).right=”2″

You are developing an application and there is a possibility of certain users using older browser versions. You want to hide the JavaScript code in the browsers that do not support JavaScript. How would you do this?

Precede the JavaScript statements with //
Precede the JavaScript statements with –
Enclose the statements with /* and */
Use the following notation:
        <script language=”javascript”>
        <!–
        //–>
        </script>
Add a <noscript> tag after the script

Consider the following JavaScript alert:
<script type="text/javascript">
function message()
{
alert("Welcome to E-Business!!!")
}
</script>
You want the user to see the above message upon opening the page, how will you implement this?

<body onload=”message()”>
<body onunload=”message()”>
<body onsubmit=”message()”>
<body onready=”message()”>

You want to move some selected paragraphs 15px towards the left relative to their normal position. The style definition should be like:

p.relt{ position:relative; left:15px;}
p.relt{ position:relative; left:-15px;}
p{ position:relative; left:15px;}
p{ position:relative; left:-15px;}

The width of the h4 is defined as follow:
H4 {width:80%;}
How can you make the heading drop shadow?

<h4 filter(shadowdrop)>Heading</h4>
<h4 style=”filter:shadowdrop()”>Heading </h4>
<h4 style=”filter:DropShadow()”>Heading </h4>
<h4 style=”DropShadow ()”>Heading </h4>
<h4 filter(dropshadow)>Heading</h4>
<h4 style=”filter::shadowdrop()”>Heading </h4>

Is the following statement correct?
The width of an element must be set for making filters work.

Yes
No

You have a function to change the image with id imageID at runtime: function changeimg(givenImg)
{
document.getElementById(‘imageID’).src=givenImg
}
How would you make the webpage display “image2.gif”, only for the time that the user clicks the image?

<img id=”imageID” src=”image1.gif” width=”50″ height=”60″ onmousedown=”changeimg(image1.gif)” onmouseup=”changeimg(image2.gif)”>
<img id=”imageID” src=”image1.gif” width=”50″ height=”60″ onmousedown=”changeimg(image2.gif)” onmouseup=”changeimg(image1.gif)”>
<img id=”imageID” src=”image2.gif” width=”50″ height=”60″ onmousedown=”changeimg(image1.gif)” onmouseup=”changeimg(image2.gif)”>
<img id=”imageID” src=”image2.gif” width=”50″ height=”60″ onmousedown=”changeimg(image2.gif)” onmouseup=”changeimg(image1.gif)”>

What is the error in the statement var charConvert = toCharCode(‘x’)?

toCharCode() is a bogus method
Nothing. It will work fine
toCharCode accepts only numbers
toCharCode takes no arguments

The width of h3 is defined as follows:
H3 {width:90%;}
How can you make the heading flip vertically?

<h3 filter(flip)>Heading</h3>
<h3 style=”filter:flipv()”>Heading </h3>
<h3 style=”filter::flipv()”>Heading </h3>
<h3 style="FlipvFilter()">Heading </h3>

Your website displays a few articles on java programming. If you want to leave ’1 cm’ space above and below the code blocks, you would use code { margin-top:1cm ; margin-bottom:1cm }.

True
False

Which of the following is not a JavaScript event?

ondblclick
onmousemove
onclick
onblink

Which of the following is not a JavaScript event?

onmouseover
onmouseout
onmousepress
onmousedown

Which of the following is not a JavaScript event?

onabort
onchange
onupdate
onkeydown

You are developing a website for children. You want to format the borders of big <td> cells (as mentioned below) for some fun game: Left Border:double
Right Border:dashed
Top Border:dotted
Bottom Border:solid
Which of the following would be the correct style definition?

border-style:double dotted dashed solid
border-style:dotted dashed solid double
border-style:solid double dotted dashed

What is the default value for overflow property?

scroll
visible
hidden
auto

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

randomElement = myStuff[Math.floor(Math.random() * myStuff.length)];
randomElement = myStuff[Math.ceil(Math.random() * myStuff.length)];
randomElement = myStuff[Math.random(myStuff.length)];
randomElement = myStuff[Math.ceil(Math.random()*myStuff.length - 1)];

Which of the following is an important parameter of the wave filter?

WaveSize
Wavelength
Strength
All of the above

Consider an HTML form with a checkbox and a text field. When data is entered and the Enter key is pressed, the data seems to be lost before the user can click on the button that calls the processing function. How would you correct this programatically?

Add a TYPE=HIDDEN INPUT to the form
Trap the Enter keypress and return (null)
Add ‘return false’ to onsubmit=”…” in the FORM tag
Instruct the user not to press the Enter key
Modify the ENCTYPE property of the form

Choose another way to write x ? a = b : a = c

if (‘x’) { a = b; } else { a = c; }
if (x) { a = c; } else { a = b; }
x : a = c ? a = b
None of the above

You are required to create a web page in which hyperlinked sub-headings are displayed. On clicking a link, the contents should get displayed dynamically. Which of the following style attributes would you use for this?

visibility:hidden;
visibility:display;
visibility:visible;
visibility:none;

Following is a sample CSS style:
1. p
2. (
3. font-family:arial
4. color:black
5. text-align:left
6. );
What are the corrections required in this style?

The style definition should be enclosed in curly braces
Multiple items within a style should be separated by “;”
The style should not close with a semicolon
All of the above

Which of the following is not a CSS filter?

alpha
beta
xray
xray

You want to delete an element from an options array. How would you do it?

Set it to false
Set it to null
Set it to undefined
Set it to -1
Set it to 0
Set it to 1

You have created an object. How can you add a property to the object class?

With the prototype() method
With the prototype property
It cannot be done
With the this object

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 of the following events would you use?

onblur
onfocus
lostfocus
gotfocus
None of the above

A DHTML page contains a table in between some text. You want to shift the table 20 pixels on the right to separate it from text. Which of the following styles would be suitable for the purpose?

position:relative;
left:20PX;
position:relative;
left:-20PX;
position:relative;
right:-20PX;
position:relative;
right:20PX;

When does the load event of the browser occur?

When the browser receives the page header information
When the browser starts displaying the content
When the browser receives all the page information, including framesets
When the browser receives all the page information, including framesets and displays it
None of the above

An HTML form has 10 checkboxes which are all named “chkItems”. Which JavaScript function can be used for checking all the checkboxes together?

function CheckAll()
{
for (z = 0; z < document.forms.chkItems.length; z++)
{
document.forms.chkItems[z].checked=true
}
}
function CheckAll()
{
        for (z = 0; z < document.forms[0].chkItems.length; z++)
        {
        document.forms[0].chkItems[z].checked=true
        }
}
function CheckAll()
{
for (z = 0; z < document.forms[0].chkItems.length; z++)
{
document.forms[0].chkItems.list[z].checked=true
}
}
function CheckAll()
{
for (z = 0; z < document.forms[0].chkItems.length; z++)
{
document.forms[0].chkItems.list[z].checked=false
}
}

What is the default value for z-index?

-1
1
0
null
auto

How will you change the color of the paragraph text to blue on placing the mouse over the paragraph, and reset it back when the mouse leaves the paragraph?

<p onmouseover=”style.color=’black’” onmouseout=”style.color=’blue’”> The text of the paragraph..</p>
<p onmouseover=”style.color=’blue’” onmouseout=”style.color=’black’”> The text of the paragraph..</p>
<p onmouseout=”style.color=’blue’”> The text of the paragraph..</p>
<p onmouseover=”style.color=’blue’”> The text of the paragraph..</p>

You are setting cookies with JavaScript. What happens to cookies.txt data if the file exceeds the maximum size?

Your script automatically generates a run-time error
Your script automatically generates a load-time error
The file is truncated to the maximum length
None of the above

You are formatting your error messages using the following inline style definition:
<span class="error" style="color: red">Error message.</span>
Now you want the error message text to be displayed in blue color. But the problem is that you are not permitted to edit the HTML code, you can only edit the imported style sheet. Which style definition will you use in the imported style sheet to achieve this?

span.error{color: blue;}
span.error{ color: blue !important;}
span.error{ color: blue !inherit;}
It is impossible. Inline styles always override imported styles

How can you change the image position from  relative to absolute if the image id is “ERImage”?

document.getElementById(‘ERImage’).position=”absolute”
document.getElementById(‘ERImage’).setAttribute(position, “absolute”)
document.getElementById(‘ERImage’).style.position=”absolute;”
document.getElementById(‘ERImage’).style.position=”absolute”

How will you display text as a superscript?

vertical-align: super
vertical-align: superscript
vertical-align: top
text-align: super
text-align: superscript

Which of the following code snippets is more effective? Why is it so?
<script language="javascript">
        for(i=0;i<document.images.length;i++)
                document.images[i].src="blank.gif";

</script>

<script language="javascript">
        var theimages = document.images;
        for(i=0;i<theimages.length;i++)
                theimages[i].src="blank.gif"
</script>

Both are equally efficient
The first code is more efficient as it contains less coding
The first code is more efficient as it employs object caching
The second code is more efficient as it employs object caching

You declared an array as follows:
var arr;
What value would JavaScript assign to an uninitialized element of this array?

NaN
null
undefined
false
0

You have defined an image tag as follows:
<img id="ERImage" width="100" height="100" onmouseover="ImageChange()" src="/Image1.jpg">
How would you implement ImageChange() function, if the new image to be set for mouseover is Image2.jpg?

document.getElementById(‘ERImage’).src=”Image1.jpg”
document.getElementById(‘ERImage’).src=”Image2.jpg”
document.getElementById(‘ERImage’).style.src=”Image1.jpg”
document.getElementById(‘ERImage’).style.src=”Image2.jpg”

Which of the following is used to display an image behind the paragraph text?

set negative z-index for the image
set positive z-index for the image
set negative z-index for the paragraph
set positive z-index for the paragraph
set z-index=0 for the paragraph
set z-index=0 for the image

You have this image definition:
<img id="logo" src="/companylogo1.gif" height="12" width="12" >
Which of the following would be helpful for changing the image to "companylogo2.gif" on page load?

logo.source=”companylogo2.gif”
logo.source=”companylogo1.gif”
document.getElementById(‘logo’).src=”companylogo1.gif”
document.getElementById(‘logo’).src=”companylogo2.gif”

For making the text transparent, the mask filter can be used like:

mask(color=#ff00ff)
mask(color=#ffffff)
mask(#ffffff)
mask(#ff00ff)

Which of the following in-built functions is useful when you want to access a form element using its id?

getItem(id)
getFormElement(id)
getElementById(id)
All of the above

How would you double the image size of an Image on a mouseover event, if the original width and height are 100px and id is logo?

document.getElementById(‘logo’).style.width=”200″
document.getElementById(‘logo’).style.height=”200″

document.getElementById(‘logo’).style.width=”100″
document.getElementById(‘logo’).style.height=”100″

document.getElementById(‘logo’).width=”200″
document.getElementById(‘logo’).height=”200″

document.getElementById(‘logo’).width=”200px”
document.getElementById(‘logo’).height=”200px”

How is the following code useful?
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”;
break;
}
}
if(ok==”no”)
{
alert(“error”);
field.focus();
}
}

It will force a user to enter only numeric values
It will force a user to enter only alphanumeric values
It will force a user to enter only character values
None of the above

You are designing a web site and need to set the background image for all the web pages. You want a small background image to repeat and fill up the whole background. Which of the follow
ing body styles is ideal for this?

body { background: url(/images/bg.gif);
repeat: repeat-x }

body { background: url(/images/bg.gif);
repeat: repeat-y }

body { background-image: url(/images/bg.gif);
background-repeat: no-repeat }

Body{background: url(/image/bd.gif);

The width of h3 is defined as follow:
H3 {width:100%;}
How can you make the heading glow?

<h3 filter(glow)>Heading</h3>
<h3 style=”filter:glow()”>Heading </h3>
<h3 style=”filter::glow()”>Heading </h3>
<h3 style=”GlowFilter()”>Heading </h3>

The following code snippet is used in form validation, the validate function is supposed to return a true if all validations are successful and false if the validation fails. However, the data is always submitted even if the validation fails, what could the cause be?
<form name="frmadd" method="post" action="add.asp" onsubmit="validate()">

There is no error, the code is fine
There should be a return statement before the call to the validate function
onsubmit=”validate()” should be replaced with “javascript:validate()”

You want to position a heading at 15 pixels from the left of the page and 20 pixels from the top of the page. The style definition should be:

h2.side{ position:relative;  left:15px; top:20px;}
h2.side{ position:absolute; left:15px; top:20px;}
h2{ position:relative; left:15px; top:20px;}
h2{ position:absolute; left:15px; top:20px;}

You want to move all the paragraphs 30px towards the right relative to their normal position. The style definition should be:

p.relt{ position:relative; left:30px;}
p.relt{ position:relative; left:-30px;}
p{ position:relative; left:30px;}
p{ position:relative; left:-30px;}

You want to position all the h2 headings on the page at 15 pixels from the left of page and 20 pixels from the top of the page. The style definition should be:

h2.side{ position:relative;  left:15px; top:20px;}
h2.side{ position:absolute; left:15px; top:20px;}
h2{ position:relative; left:15px; top:20px;}
h2{ position:absolute; left:15px; top:20px;}

Given below is a window.open function:
window.open(url,name,"attributes")
How will you ensure that different URLs open in the same window?

By keeping the second attribute name same
By nullifying the name attribute
By omitting the name attribute
None of the above

This is a JavaScript function for changing the color of the text box named “txtName”: function SetColor(col)
{ document.forms[0].txtName.style.background=col }
How will you change the color of the text box txtName to green, only for the time that the user is pressing any key?

<input type=”text” onkeydown=”SetColor(‘white’)” onkeyup=”SetColor(‘green’)” name=”txtName”>
<input type=”text” onkeydown=”SetColor(‘green’)” onkeyup=”SetColor(‘white’)” name=”txtName”>            
<input type=”text” onkeydown=”SetColor(‘green’)” name=”txtName”>
<input type=”text” onkeydown=”SetColor(‘white’)” name=”txtName”>

Which of the following style properties is used to display only a part of an image?

snap
clip
scroll
visible
overflow
size

Which of the options is true for the following style, if h2 and h3 will be positioned on the top of each other?
h2{z-index:1;}
h3{z-index:2;}

h2 will be on the top of h3
h3 will be on the top of h2
h3 will be on the right of h2
h2 will be on the right of h3

Which of the following can you use to accept user input?

The prompt method
The alert method
A form field
The confirm method

The width of H1 is defined as follows:
H1 {width:100px;}
How can you make the heading flip horizontally?

<h1 filter(flip)>Heading</h1>
<h1 style=”filter::fliph()”>Heading</h1>
<h1 style=”filter:fliph()”>Heading</h1>
<h1 style=”FliphFilter()”>Heading</h1>

What does the following code snippet do?
<input type="radio" name="r1" value="radio1" onclick="this.checked=false;alert('sorry')">

The code is incorrect
The code makes it necessary for the user to select the radio button
The code disables the radio button
The code displays an alert when the user selects the button

You want to display an alert that contains a ' (single-quote) character. Which of the following characters would you use to escape the ' character?

*
\
/
_
#
%
|
~

The anchor tag is defined as follows:
<a href="http://expertrating.com">expertrating</a>
Which of the following styles will increase the spacing between letters on mouseover?

a:hover { spacing: 1px;}
a:hover { spacing: 2px;}
a:hover { letter-spacing: 0;}
a:hover { letter-spacing: 2px;}

You have embedded the document.write() method to write some text within a pair of <TD></TD> table tags. On loading the file, you get some garbled junk on the page that should contain the text. What makes this happen?

The browser does not support JavaScript
You are using an outdated version of the browser
The browser does not support cookies
None of the above

You developed a web page using HTML and style sheets. You defined H4 style in the head tag, imported style sheet, as well as inline. Which of the following style definitions is used when the page is rendered in a browser?

Default browser H4 definition
External style sheet definition
Inline style definition
Style definition in the head tag

Which of the following properties is used to redirect a visitor to another page?

document.URL
window.location.href
document.location.href
link.href
window.location

How would you change the image position from absolute to relative, if the image id is “ERImage”?

document.getElementById(‘ERImage’).position=”relative”
document.getElementById(‘ERImage’).setAttribute(“position”, “relative”)
document.getElementById(‘ERImage’).style.position=”rel”
document.getElementById(‘ERImage’).style.position=”relative”

Which of the following statements with regard to CSS is correct?

The positioning can be absolute, relative, or dynamic
The float property for text/image can be left, right, or center
The values for visibility can be true or false
The display property sets how an element is displayed

You are collecting the user’s details on a webpage form. The id has to be repeated twice on the form, but you want the user to fill it once only. If the name of the first id is id1 and the second (to be auto filled) is id2, which code will you supply to the onkeyup event of id1?

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

DHTML is a standard defined by the World Wide Web Consortium.

True
False

Which of the following helps you make the text color change to green on moving the mouse over the text?

a:hover {color: green;}
a:visit {color: green;}
a: active {color: green;}
a:onmouseover {color: green;}

Which of the following is not considered a part of DHTML?

JavaScript
CSS
HTML
VBScript
All are part of DHTML

You want to disable the selection of text on the webpage. While trying to select some text, the user should see ‘not-allowed’ cursor. Which of the following helps you implement this by using JavaScript and IE 5+ browser?

<body onSelectEnd=”this.style.cursor=’not-allowed’; return true;”
onMouseup=”this.style.cursor=’default’”>

<body onMouseDown=”this.style.cursor=’default’”
onSelectEnd=”this.cursor=’not-allowed’; return false;”>

<body onSelectStart=”this.style.cursor=’not-allowed’; return false;”
onMouseup=”this.style.cursor=’default’”>

<body onMouseup=”this.style.cursor=’not-allowed’; return false;”
onSelectStart=”this.style.cursor=’default’”>

Which of the following statements is true with regard to setTimeout()?

The statement(s) it executes run(s) only once
It pauses the script in which it is called
clearTimeout() does not stop its execution
It is required in every JavaScript function

What does the following code snippet do?
<input type=”radio” name=”r1″ value=”radio1″ onclick=”this.checked=false;alert(‘sorry’)”>

The code is incorrect
The code makes it necessary for the user to select the radio button
The code disables the radio button
The code displays an alert when the user selects the button

You have two images of buttons, one bright and the other one dull. You want to change the dull image into a bright one. Which of the following attributes would you use with the img tag?

onmousedown="this.src='bright.gif'"
onmouseup="this.src='dull.gif'"

onmousedown="bright.gif"
onmouseup="dull.gif"

onmouseup="this.src='bright.gif'"
onmousedown="this.src='dull.gif'"

What will the following code snippet do?
<form onreset="alert('Please again fill the form')">

It validates the contents of the form
It prompts the user not to leave the fields of the form empty
It prompts the user to fill the form once the form is cleared
None of the above

Sliding menus can be made using DHTML?

True
False

Which of the following helps you highlight some of the running text on a web page?

<span style="background-color:yellow">
<span style="background-highlight:yellow">
<span style="background:yellow">
<span style="highlight-color:yellow">

Which of the following helps you import a style sheet named "ssa.css" in the web page?

 <a link="stylesheet" url="ssa.css">
<link rel="stylesheet" type="text/css" href="/ssa.css">
<style name="stylesheet" url="ssa.css">
<link item="stylesheet" type="text/css" href="/ssa.css">

DHTML Test Fiverr 2020