1.
Difference b/w confirm and alert
Correct Answer
B. Confirm provides choice
Explanation
The given answer correctly states that the main difference between confirm and alert is that confirm provides a choice or option to the user, whereas alert does not. Confirm displays a pop-up box with a message and two buttons (usually "OK" and "Cancel") allowing the user to choose between different options. On the other hand, alert only displays a pop-up box with a message and an "OK" button, providing the user with no choice or options.
2.
Which one is correct?i) function one(var a)ii) function two(a)
Correct Answer
C. Ii
Explanation
The correct answer is ii because "function two(a)" is the correct syntax for defining a function with a parameter named "a". The syntax "function one(var a)" is incorrect because "var" is not necessary when declaring a parameter in JavaScript.
3.
Selection change event of html radio button
Correct Answer
C. Onclick
Explanation
The correct answer is "onclick". This is because the onclick event is triggered when the radio button is clicked by the user. The other options mentioned, such as onselectedindexchanged, onchange, and ondbclick, are not valid events for radio buttons in HTML.
4.
GetDate() retruns?
Correct Answer
C. Day of month
Explanation
The getDate() function in JavaScript returns the day of the month from a given date. It extracts the numerical value representing the day from the date object and returns it as an output. This function is commonly used to retrieve the specific day of the month from a date object.
5.
Is JavaScript case sensitive?
Correct Answer
A. Yes
Explanation
JavaScript is case sensitive, meaning that it distinguishes between uppercase and lowercase letters. This means that variables and function names must be written with the exact same casing each time they are used. For example, a variable named "myVariable" is not the same as "myvariable" or "MyVariable". Therefore, it is important to be consistent with casing when writing JavaScript code to avoid potential errors or bugs.
6.
How to create arrays in JavaScript?
Correct Answer
B. Var arr = new Array();
Explanation
The correct answer is "var arr = new Array();". This is the correct way to create an array in JavaScript using the Array constructor. The other options are incorrect syntax or invalid ways of creating an array.
7.
What does "1"+2+4 evaluate to?
Correct Answer
C. 124
Explanation
When the string "1" is added to the number 2, it results in the string "12". Then, when the string "12" is added to the number 4, it concatenates to form the string "124". Therefore, the expression "1"+2+4 evaluates to "124".
8.
What does 3+4+"7" evaluate to?
Correct Answer
B. 77
Explanation
In this expression, the numbers 3 and 4 are added together, resulting in 7. However, the string "7" is concatenated to the previous result, rather than being added mathematically. Therefore, the final result is "77".
9.
Iframe in HTML is used to display -- within a web page.
Correct Answer
C. A web page
Explanation
The correct answer is "a web page". The iframe element in HTML is used to embed or display content from another web page within the current web page. It allows you to include external content such as videos, maps, or social media feeds seamlessly within your own web page.
10.
Which of the following is true about links by default?
Correct Answer
A. An unvisited link is underlined and blue.
Explanation
By default, an unvisited link is underlined and blue. This is a common convention in web design to indicate to users that the link has not been clicked on yet. When a user clicks on a link and visits the page, the link becomes a visited link and is typically underlined and red. An active link, on the other hand, is underlined and purple to indicate that the user is currently interacting with it. Therefore, the correct answer is that all of the given statements are true about links by default.
11.
The href attribute in the link tag specifies the:
Correct Answer
A. Destination of a link.
Explanation
The href attribute in the link tag specifies the destination of a link. It is used to define the URL or file path that the link should navigate to when clicked. This attribute is essential for creating clickable links on web pages.
12.
Which one is correct to assign images path in <img> tag control?
Correct Answer
A. SRC="http://www.computerhope.com/chguy.gif"
Explanation
The correct way to assign image path in the tag control is by using the attribute SRC="http://www.computerhope.com/chguy.gif". This attribute specifies the URL of the image that should be displayed.
13.
HTML Form Events ___________, fires the moment that the element loses focus.
Correct Answer
D. Onblur
Explanation
The onblur event in HTML form events is triggered when an element loses focus. This means that when a user clicks outside of the element or tabs away from it, the onblur event is fired. It is commonly used to validate input or perform actions when the user finishes interacting with a specific form element.
14.
Which of the following tags below are used for a multi-line text input control?
Correct Answer
C. Textarea tag
Explanation
The correct answer is the textarea tag. This tag is used for creating a multi-line text input control in HTML. It allows users to enter and edit multiple lines of text. The textml tag and text tag are not valid HTML tags for creating multi-line text input controls.
15.
What is the difference between XML and HTML?
Correct Answer
B. XML is used for exchanging data, HTML is not.
Explanation
XML (Extensible Markup Language) and HTML (Hypertext Markup Language) are both markup languages, but they serve different purposes. HTML is primarily used for creating web pages and displaying content on the internet. It focuses on how the content should be presented to the user, including text formatting, links, images, etc. On the other hand, XML is a flexible language that is used for storing and exchanging structured data. It allows users to define their own tags, making it highly customizable and adaptable to various data formats. Unlike HTML, XML is not concerned with presentation, but rather with the organization and structure of data. Therefore, the correct answer is that XML is used for exchanging data, while HTML is not.