DHTML Test
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 t...
An HTML form has 10 checkboxes which are all named "chkItems". Which JavaScript function can be used for checking all the checkboxes together?
Choose another way to write x ? a = b : a = c
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 processin...
Consider the following validate function: <script type="text/javascript"> function ValidateField() { if(document.forms[0].txtId.value =="") {return false;} return ...
Consider the three variables: someText = 'JavaScript1.2'; pattern = /(w+)(d).(d)/i; outCome = pattern.exec(someText); What does pattern.ignoreCase contain?
DHTML is a standard defined by the World Wide Web Consortium.
DHTML uses a combination of:
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?
For making the text transparent, the mask filter can be used like:
Given below is a window.open function: window.open(url,name,"attributes") How will you ensure that different URLs open in the same window?
How can you change the image position from relative to absolute if the image id is "ERImage"?
How can you use a timer with a function called rearrange()?
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++) { ...
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?
How will you display text as a superscript?
How would you change the image position from absolute to relative, if the image id is "ERImage"?
How would you create a popup window that closes after n seconds?
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?
How would you randomly choose an element from an array named myStuff if the number of elements changes dynamically?
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?
How would you test whether or not a browser window is open?
If an image is placed styled with z-index=-1 and a text paragraph is overlapped with it. Which one will come on top?
Is the following statement correct? The width of an element must be set for making filters work.
Sliding menus can be made using DHTML?
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?
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?
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 a...
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 stat...
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...
The width of H1 is defined as follows: H1 {width:100px;} How can you make the heading flip horizontally?
The width of h3 is defined as follow: H3 {width:100%;} How can you make the heading glow?
The width of h3 is defined as follows: H3 {width:90%;} How can you make the heading flip vertically?
The width of the h4 is defined as follow: H4 {width:80%;} How can you make the heading drop shadow?
The width of the h4 is defined as follow: H4 {width:95%;} How can you make the heading blur?
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 th...
What does the following code snippet do? <input type="radio" name="r1" value="radio1" onclick="this.checked=false;alert('sorry')">
What is the default value for overflow property?
What is the default value for z-index?
What is the error in the statement var charConvert = toCharCode('x')?
What will the following code snippet do? <form onreset="alert('Please again fill the form')">
When does the load event of the browser occur?
Which code will be useful for disabling the right click event in Internet Explorer?
Which of the following can you use to accept user input?
Which of the following code snippets is more efficient and why? <script language="javascript"> for(i=0;i<document.images.length;i++) document.images[i].src="blank.gif"; </script> ...
Which of the following enables JavaScript Document Object Model to provide access to the HTTP header?
Which of the following event would execute a script once a web page has completely loaded all content?
Which of the following helps you create hyperlinks without an underline?
Which of the following helps you highlight some of the running text on a web page?
Which of the following helps you import a style sheet named "ssa.css" in the web page?
Which of the following in-built functions is useful when you want to access a form element using its id?
Which of the following is an important parameter of the wave filter?
Which of the following is not a CSS filter?
Which of the following is not a JavaScript event?
Which of the following is not considered a part of DHTML?
Which of the following is true?
Which of the following is used to display an image behind the paragraph text?
Which of the following properties is used to redirect a visitor to another page?
Which of the following properties of JavaScript is used to store the extra values for DHTML tricks?
Which of the following statements is incorrect with regard to a style sheet?
Which of the following statements is true with regard to setTimeout()?
Which of the following statements with regard to CSS is correct?
Which of the following style properties is used to display only a part of an image?
Which of the following will you use for changing the color of a button with id=btn, to green on a mouseover event?
Which of the following will you use for changing the color of the textbox text with id=txtLocation to blue, on a mouseover event?
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;}
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?
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 (...
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 following body st...
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 ...
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 ...
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 displaye...
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 wou...
You are setting cookies with JavaScript. What happens to cookies.txt data if the file exceeds the maximum size?
You declared an array as follows: var arr; What value would JavaScript assign to an uninitialized element of this array?
You defined two styles as follows: td.right {text-align: right} td.left {text-align: center} Which of the following is the right way of calling them in an HTML page?
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 i...
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?
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:
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...
You have created an object. How can you add a property to the object class?
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...
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...
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?
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?
You want to delete an element from an options array. How would you do it?
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 JavaSc...
You want to display an alert that contains a ' (single-quote) character. Which of the following characters would you use to escape the ' character?
You want to move all the paragraphs 30px towards the right relative to their normal position. The style definition should be:
You want to move some selected paragraphs 15px towards the left relative to their normal position. The style definition should be like:
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:
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:
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?
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?
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 }.