Explore topic-wise InterviewSolutions in .

This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.

1.

What does showPosition() returns?(a) only latitude(b) only longitude(c) both latitude and longitude(d) directionI have been asked this question during an interview.I'd like to ask this question from Geolocation API topic in chapter HTML Fonts, Tags and Elements of HTML

Answer»

Right choice is (c) both latitude and longitude

The explanation: showPosition() METHOD returns both latitude and longitude of USER. Syntax is navigator.geolocation.getCurrentPosition(showPosition); The value of latitude and longitude returned will be in DECIMAL.

2.

Which property is similar to C/C++ can be applied to comments?(a) for loop(b) while loop(c) ifelse(d) switch caseThis question was posed to me in an interview.This key question is from Fonts in HTML topic in section HTML Fonts, Tags and Elements of HTML

Answer»

Right choice is (c) ifelse

The best explanation: We can add conditional comments in our WEB PAGE using if and ENDIF, e.g. <!–[if age 9]>..text….<![endif]–>, there is no PROVISION of “for” or “while” loop in HTML, same apply with SWITCH case also.

3.

How many standard color names does HTML supports?(a) 120(b) 130(c) 140(d) 90I had been asked this question in unit test.This interesting question is from Fonts in HTML in portion HTML Fonts, Tags and Elements of HTML

Answer»

Correct option is (c) 140

To EXPLAIN I would SAY: In HTML one can use a color name to specify a color e.g. Tomato, Orange, DodgerBlue, MediumSeaGreen, Gray, SlateBlue, Violet, LightGray etc. For colored fonts, we USED text-decoration property to SET the color of the text.

4.

Which is not the case of invoking for error callback function?(a) user denies to share the information of a location(b) location information is unavailable(c) request timed out(d) when we are using WIFIThe question was asked in an international level competition.My doubt is from Geolocation API in chapter HTML Fonts, Tags and Elements of HTML

Answer»

Right option is (d) when we are USING WIFI

To explain: Error callback function TAKES the Position Error object as its input parameter. The function is invoked by an unknown error occurred or if the user has DENIED sharing the information of the LOCATION or if the REQUEST timed out or if location information is unavailable.

5.

_____________ in textboxes and selections on web pages is done automatically, so you do not need to handle dragging yourself.(a) Dragging HTML and XML(b) Dragging Text(c) Dragging Files(d) Dragging LinksThe question was asked in semester exam.This key question is from Drag and Drop in division HTML Fonts, Tags and Elements of HTML

Answer»

Correct option is (B) Dragging Text

For explanation I would say: Although the process is automatic, it is recommended that you ALWAYS add data of the text/plain type as a fallback for APPLICATIONS or drop targets that do not support other types, unless there is no LOGICAL text alternative. Always add the plain text type last as it is the least SPECIFIC.

6.

The ________ declaration specifies which characters and delimiters may appear in the application.(a) DTD(b) SGML(c) XML(d) HTMLThe question was posed to me by my college professor while I was bunking the class.The doubt is from Reading a Document Type Definition in chapter HTML Fonts, Tags and Elements of HTML

Answer»

Correct option is (b) SGML

Easy explanation: XML(Extensible MARKUP LANGUAGE) and HTML(Hypertext Markup Language) are web markup language used to DESIGN and create web pages. The DTD defines the syntax of markup constructs. SGML (Standard Generalized Markup Language) is a standard for how to specify a document markup language or tag set. Such a specification is itself a document type definition (DTD). SGML is METADATA.

7.

For smaller text which element is used?(a) (b) (c) (d) The question was posed to me by my school principal while I was bunking the class.My question is based upon Fonts in HTML in chapter HTML Fonts, Tags and Elements of HTML

Answer»

Right answer is (c)

The BEST I can explain: min is an attribute for INPUT method for inserting MINIMUM value. smaller text is define by element. is used for emphasis usually it is DISPLAY in ITALICS.

8.

What is the work of element?(a) contains contact details for author(b) contains IP address(c) contains home address(d) contains urlI got this question in an online interview.I need to ask this question from Fonts in HTML in division HTML Fonts, Tags and Elements of HTML

Answer»

Correct ANSWER is (a) contains contact details for author

To explain: The contact details for author of a PAGE is SPECIFIED by

ATTRIBUTE. The content is often displayed in italics,

SANFOUNDRY
9.

Which of the following property is used to determine which drag operation was desired?(a) dragend(b) getData(c) dropEffect(d) captureDataThis question was addressed to me in unit test.My query is from Drag and Drop topic in section HTML Fonts, Tags and Elements of HTML

Answer»

Correct choice is (c) dropEffect

Explanation: When the user finishes dragging an element, dragend is occurred. During the drop event, you should RETRIEVE that data that was dropped from the event and insert it at the drop location. ONE can USE the dropEffect PROPERTY to determine which DRAG operation was desired.

10.

The __________ begins with a series of parameter entity definitions.(a) DTD(b) SGML(c) XML(d) HTMLI got this question in class test.My question is from Reading a Document Type Definition in portion HTML Fonts, Tags and Elements of HTML

Answer»

The correct choice is (a) DTD

Easy explanation: SGML (Standard Generalized Markup Language) is a standard for how to specify a document markup language or tag set. XML and HTML are WEB markup language used to design and create web pages. The HTML DTD begins with a series of parameter entity definitions. A parameter entity definition defines a kind of macro that may be referenced and expanded elsewhere in the DTD. These MACROS may not appear in HTML DOCUMENTS, only in the DTD. Other types of macros, called character REFERENCES, may be used in the text of an HTML document or within attribute values.

11.

How element works?(a) override text direction(b) stops writing in the current text direction(c) only override direction of rtl text(d) only changes the direction of ltr textThe question was asked during an interview.I'd like to ask this question from Fonts in HTML in portion HTML Fonts, Tags and Elements of HTML

Answer»

Right ANSWER is (a) override text DIRECTION

Easy explanation: For bidirectional override of current text direction, we used ELEMENT, e.g. Text is right to LEFT. This element was already there before HTML5. It is supported by all the BROWSERS.

12.

Which element is used to show inserted element?(a) (b) (c) (d) This question was addressed to me in quiz.This intriguing question comes from Fonts in HTML in division HTML Fonts, Tags and Elements of HTML

Answer»

Correct option is (a)

To elaborate: element shows text that has been deleted from, usually it has a line through the content. element shows the IMPORTANCE of text/paragraph between it’s tags. element INDICATES emphasis, BROWSER will SHOW the CONTENTS of element in italic. element shows the content that has been inserted, usually it has underline.

13.

Calling the ______________ method during both a dragenter and dragover event will indicate that a drop is allowed at that location.(a) drop(b) drag(c) preventDefault(d) dataTransferI have been asked this question in an interview for internship.I would like to ask this question from Drag and Drop in division HTML Fonts, Tags and Elements of HTML

Answer»

Correct option is (c) preventDefault

To EXPLAIN: The DROP EVENT is fired on the element where the drop occurred at the end of the drag operation. When element is being DRAGGED, drag event has happened. Calling the preventDefault method during both a dragenter and dragover event will indicate that a drop is allowed at that location. However, you will commonly wish to call the preventDefault method only in certain situations, for example, only if a LINK is being dragged. The dataTransfer property of all drag events holds data about the drag and drop operation.

14.

What should be set with text-align property so that every line has equal width like in magazines and newspapers?(a) text-align: justify(b) text-align: none(c) text-align: bottom(d) text-align: topI got this question in unit test.My question is based upon Fonts in HTML in section HTML Fonts, Tags and Elements of HTML

Answer»

Correct option is (a) text-align: justify

To elaborate: By setting text-align PROPERTY to “justify”, each line is STRETCHED so that every line has EQUAL width, LEFT and right margins are straight LIKE in magazines and newspapers. Text-align: center, text-align: right, text-align: left is also used for aligning the text at center, right and left respectively.

15.

To show deleted text, which element is used?(a) (b) (c) (d) I got this question during an interview for a job.This intriguing question originated from Fonts in HTML topic in portion HTML Fonts, Tags and Elements of HTML

Answer»

Correct choice is (b)

Easy EXPLANATION: ELEMENT shows the importance of text/paragraph between it’s TAGS. element indicates emphasis, browser will show the contents of element in italic. element shows the CONTENT that has been inserted, usually it has underline. element shows text that has been deleted from, usually it has a line through the content.

16.

maximumAge returns time in _____________(a) nano-seconds(b) milliseconds(c) hour(d) secondsThis question was posed to me by my college director while I was bunking the class.The query is from Geolocation API in portion HTML Fonts, Tags and Elements of HTML

Answer»

The correct choice is (b) milliseconds

The best I can explain: The value of MAXIMUMAGE is positive long. It specifies how long the USER can use cached location data before using new location data. When its value is set to zero it INDICATES the user should not use cached location data and when set to zero is indicates the cached location data must be USED by the user.

17.

What is the default value of timeout?(a) infinity(b) 100(c) 0(d) 1000000I got this question during an interview.Origin of the question is Geolocation API in portion HTML Fonts, Tags and Elements of HTML

Answer»

The correct choice is (a) infinity

To elaborate: The value of TIMEOUT is positive LONG value. It specifies the MAXIMUM TIME in milliseconds which the user has taken to RESPOND with the data of the location. Its default value is infinity.

18.

Which event is fired as the mouse is moving over an element when a drag is occurring?(a) dragover(b) dragenter(c) dragstart(d) dragleaveI had been asked this question in homework.My enquiry is from Drag and Drop topic in section HTML Fonts, Tags and Elements of HTML

Answer»

The correct answer is (a) dragover

For explanation: The dragover EVENT is fired as the mouse is moving over an element when a drag is occurring. Much of the time, the operation that occurs during a listener will be the same as the dragenter event. When draggable element enters a drop target then dragenter event has OCCURRED. A dragleave event occurs when it leaves the valid drop target. WHENEVER a USER starts to drag an element, dragstart is fired.

19.

Which element is used for abbreviation or acronym?(a) (b) (c) (d) I got this question by my college professor while I was bunking the class.This intriguing question originated from Fonts in HTML topic in portion HTML Fonts, Tags and Elements of HTML

Answer» RIGHT CHOICE is (c)

Explanation: ELEMENT indicates emphasis, browser will show the contents of element in italic. We used element for shorter quote. Browser put quote around element. A section which is quoted from ANOTHER SOURCE is specified by
. For using, abbreviation or acronym element is helpful. A title element is to be used with abbr.
20.

Which of the following is not set with font-style property?(a) font-style: normal(b) font-style: italic(c) font-style: oblique(d) font-style: capitalizeThe question was posed to me in unit test.My query is from Fonts in HTML in section HTML Fonts, Tags and Elements of HTML

Answer»

The correct choice is (d) font-style: capitalize

Explanation: TEXT-transform: capitalize, CAPITALIZES the first letter of each WORD whereas font-style SET font as normal, italic, oblique. We use text-transform: uppercase and text-transform: lowercase to CHANGE the text from lowercase to uppercase and from uppercase to lowercase respectively.

21.

Which parameter gives an accuracy of longitude and latitude?(a) Accuracy(b) AltitudeAccuracy(c) enableHighAccuracy(d) Extra accuracyThe question was posed to me in a job interview.The origin of the question is Geolocation API topic in section HTML Fonts, Tags and Elements of HTML

Answer»

The CORRECT option is (a) ACCURACY

The explanation is: Accuracy of latitude and longitude coordinates is given by ‘accuracy’. It is in meters. Cords.altitudeAccuracy GIVES altitude accuracy of the position of the object. enableHighAccuracy is a Boolean variable which gives the most ACCURATE position.

22.

Success callback function evoke only when ___________(a) user accepts to share location information(b) always evoke(c) gps is accessible(d) only by mobile browserThis question was addressed to me in final exam.Enquiry is from Geolocation API topic in portion HTML Fonts, Tags and Elements of HTML

Answer» CORRECT answer is (a) USER accepts to share location information

The best explanation: There is a privacy for SHARING of user’s location and the CALLBACK function is evoke only when a user accepts to share his location. Its input PARAMETER is a position of the object. If this function fails then error callback function will be evoked.
23.

Which of the following is not used with text-decoration property?(a) overline(b) underline(c) line-through(d) inlineThe question was asked in unit test.This intriguing question comes from Fonts in HTML in chapter HTML Fonts, Tags and Elements of HTML

Answer»

The CORRECT answer is (d) inline

To explain I would say: overline, UNDERLINE, line-through PROPERTIES are USED to decorate the TEXT.

24.

A model group contains the names of the elements that a tag may enclose.(a) True(b) FalseThe question was asked in quiz.My question is from Reading a Document Type Definition in portion HTML Fonts, Tags and Elements of HTML

Answer» RIGHT CHOICE is (a) True

The explanation is: Most HTML and XHTML ELEMENTS ENCLOSE content. If a content model is declared, it is enclosed within parentheses and known as a model group.
25.

Which property is like the GPS in car?(a) watchPosition()(b) clearWatch()(c) getCurrentPosition()(d) showPosition()I got this question in a job interview.Query is from Geolocation API topic in portion HTML Fonts, Tags and Elements of HTML

Answer»

The correct choice is (a) watchPosition()

Easiest EXPLANATION: Current position of the USER is returned by watdhPosition(). It update the position os th user as the user moves just like the GPS installed in a CAR. WatchPosition() METHOD is stopped by clearWatch() method. E.g. if(navigator.geolocation){navigator.watchPosition(showPosition);}

26.

______________ should include data of two types; the first should be the URL using the type text/uri-list, and the second is the URL using the text/plain type.(a) Dragging HTML and XML(b) Dragging Text(c) Dragging Files(d) Dragging LinksI had been asked this question during an interview for a job.This is a very interesting question from Drag and Drop topic in chapter HTML Fonts, Tags and Elements of HTML

Answer»

The CORRECT option is (d) Dragging LINKS

Explanation: Dragging Links should include DATA of TWO TYPES; the first should be the URL using the type text/uri-list, and the second is the URL using the text/plain type.

27.

Which of the following is not the property of the ‘cords’ object?(a) Accuracy(b) Altitude(c) AltitudeAccuracy(d) enableHighAccuracyI had been asked this question by my school principal while I was bunking the class.The question is from Geolocation API topic in division HTML Fonts, Tags and Elements of HTML

Answer»

Correct OPTION is (d) enableHighAccuracy

Explanation: CORDS object has properties like Latitude, longitude, ALTITUDE, accuracy, AltitudeAccuracy, speed, heading. Cords.speed defines speed in meters per second. Cords.heading defines degrees CLOCKWISE from NORTH.

28.

Which of the following technique is not for the mobile browser to identify the location of a user?(a) GPS(b) IP based position(c) WIFI based position(d) A-GPSI got this question in homework.Question is from Geolocation API topic in portion HTML Fonts, Tags and Elements of HTML

Answer»

Right answer is (b) IP BASED position

The explanation is: Geolocation API uses the various TECHNIQUES to identify the location of a USER. In desktop browser uses IP bases position TECHNIQUE or WIFI. Mobile browser uses A-GPS, WIFI based position or GPS.

29.

The ___________ keyword begins the declaration of attributes that an element may take. It is followed by the name of the element in question, a list of attribute definitions, and a closing.(a) DOCTYPE(b) ATTLIST(c) DTD(d) SGMLThis question was addressed to me during an interview for a job.Question is taken from Reading a Document Type Definition topic in chapter HTML Fonts, Tags and Elements of HTML

Answer»

Correct option is (a) DOCTYPE

To explain: The ATTLIST declarations IDENTIFY which element types may have attributes, what type of attributes they may be, and what the default value of the attributes are. The DTD defines the syntax of markup constructs. The DTD may include additional definitions such as character entity REFERENCES. SGML (Standard Generalized Markup LANGUAGE) is a standard for how to specify a document markup language or tag set. In HTML 4.01, the !DOCTYPE declaration refers to a DTD, because HTML 4.01 was based on SGML. The DTD specifies the rules for the markup language so that the browsers render the content correctly.

30.

Which works similar to element?(a) (b) (c) (d) This question was posed to me in class test.Question is from Fonts in HTML topic in section HTML Fonts, Tags and Elements of HTML

Answer» CORRECT ANSWER is (b)

Best explanation: element SHOWS the importance of TEXT/paragraph between it’s tags. makes text bolder. A section which is quoted from another SOURCE is specified by
. element indicates emphasis, browser will show the contents of element in italic.
31.

Which of the following property does not has always a return?(a) coords.longitude(b) coords.latitude(c) coords.accuracy(d) coords.altitudeI got this question at a job interview.I'd like to ask this question from Geolocation API in chapter HTML Fonts, Tags and Elements of HTML

Answer»

Correct option is (d) coords.altitude

For EXPLANATION I would say: coords.latitude is the latitude in decimal number, coords.longitude is the value of longitude in decimal number, coords.altitude RETURNS the value above mean sea LEVEL in meters if and only is RETURN is available there.

32.

What timestamp property denotes?(a) time at which WIFI is used(b) the time at which data of the location is retrieved(c) the time at which callback function is evoked(d) current timeThis question was addressed to me in an interview.My question is based upon Geolocation API in portion HTML Fonts, Tags and Elements of HTML

Answer»

The correct answer is (b) the TIME at which DATA of the location is retrieved

The explanation is: The time at which data of the location is retrieved denoted by TIMESTAMP property. This also provides the date. Timestamp is a read-only property.

33.

Which method is used to get user’s position?(a) getCurrentPosition()(b) getDirectPosition()(c) post()(d) getDirectionThis question was addressed to me in a job interview.I'm obligated to ask this question of Geolocation API topic in chapter HTML Fonts, Tags and Elements of HTML

Answer»

Right option is (a) GETCURRENTPOSITION()

The explanation is: For getting user’s position we USED getCurrentPosition() method. Syntax is navigator.geolocation.getCurrentPosition(showPosition). It is supported by most of the BROWSERS like Chrome, Firefox, INTERNET EXPLORER, Opera etc.

34.

A listener for the dragenter and dragover events are used to indicate valid drop targets, that is, places where dragged items may be dropped.(a) True(b) FalseThe question was posed to me in an interview for job.The query is from Drag and Drop in division HTML Fonts, Tags and Elements of HTML

Answer» RIGHT option is (a) True

The EXPLANATION is: The dragover event is fired as the mouse is moving over an ELEMENT when a drag is occurring. Much of the time, the operation that occurs during a listener will be the same as the dragenter event. When draggable element ENTERS a drop target then dragenter event is occurred.
35.

Which of the following property is common in all drag events?(a) drag effects(b) drag data(c) dataTransfer(d) dragenterThe question was posed to me in an interview.My query is from Drag and Drop in section HTML Fonts, Tags and Elements of HTML

Answer»

Correct option is (c) dataTransfer

Explanation: The feedback GIVEN by the user USING drag and DROP operation is done by drag EFFECTS. Drag data includes all the data needed for drag operation. The dataTransfer property of all drag events holds data about the drag and drop operation. When draggable element enters a drop target then dragenter event is occurred.

36.

The __________ defines the syntax of markup constructs and include additional definitions such as character entity references.(a) Attributes(b) SGML(c) Elements(d) DTDThe question was asked in exam.Enquiry is from Reading a Document Type Definition topic in division HTML Fonts, Tags and Elements of HTML

Answer» RIGHT option is (d) DTD

Best explanation: SGML (STANDARD Generalized Markup LANGUAGE) is a standard for how to specify a document markup language or tag set. Property of an element is defined by the attribute. The DTD defines the syntax of markup constructs. The DTD may INCLUDE additional definitions such as character ENTITY references.
37.

_____________ and elements in a document may be dragged using the application/x-moz-node type.(a) Dragging HTML and XML(b) Dragging Text(c) Dragging Nodes(d) Dragging LinksThis question was addressed to me in an international level competition.I'd like to ask this question from Drag and Drop topic in chapter HTML Fonts, Tags and Elements of HTML

Answer»

The correct OPTION is (c) Dragging Nodes

To elaborate: Dragging Nodes and elements in a DOCUMENT may be DRAGGED USING the application/x-moz-node type.

38.

A/An _________ is essentially a macro that allows a short name to be associated with the replacement text.(a) Entity(b) Attribute(c) Comment(d) ElementThe question was posed to me during an online exam.This intriguing question originated from Reading a Document Type Definition topic in portion HTML Fonts, Tags and Elements of HTML

Answer»

Correct choice is (a) Entity

The EXPLANATION is: Comments are USED to PROVIDE idea about coding syntax which is ignored by the browser.Reserved characters in HTML must be replaced with character entities. Characters, not present on your keyboard, can also be replaced by entities. Property of an ELEMENT is defined by the attribute.

39.

The _________ event is fired on the element where the drop occurred at the end of the drag operation.(a) drag(b) drop(c) dragstart(d) dragenterThe question was posed to me in examination.I want to ask this question from Drag and Drop topic in chapter HTML Fonts, Tags and Elements of HTML

Answer»

The correct option is (B) drop

To ELABORATE: The drop event is fired on the element where the drop OCCURRED at the end of the DRAG operation. A listener would be responsible for retrieving the data being DRAGGED and inserting it at the drop location. Whenever user starts to drag an element, dragstart is fired. When draggable element enters a drop target then dragenter event is occurred. When element is being dragged, drag event is happened.

40.

Which element defines a title of the Work?(a) (b) (c) (d) This question was addressed to me during an interview for a job.My question is from Fonts in HTML topic in portion HTML Fonts, Tags and Elements of HTML

Answer»

Right CHOICE is (b)

The explanation is: For using, ABBREVIATION or ACRONYM element is helpful.The contact details for author of a PAGE is specified by

attribute. A section which is quoted from another source is specified by
.The tittle of a Work is defined by ELEMENTS, usually it displays in italics.

41.

Which element is used for short quote?(a) (b) (c) (d) The question was asked in final exam.This interesting question is from Fonts in HTML topic in chapter HTML Fonts, Tags and Elements of HTML

Answer»

Right answer is (a)

Explanation: element INDICATES emphasis, browser will SHOW the CONTENTS of element in italic. A section which is quoted from another source is SPECIFIED by

. The defines abbreviation. We used element for shorter QUOTE. Browser put quote around element.

42.

What does getCurrentPosition() returns?(a) latitude(b) longitude(c) direction(d) coordinatesI got this question in an online interview.My question is based upon Geolocation API topic in chapter HTML Fonts, Tags and Elements of HTML

Answer»

The correct ANSWER is (d) coordinates

Explanation: Coordinates of object is return by GETCURRENTPOSITION() method. getCurrentPosition() function accepts three parameters i.e. SUCCESS, position and ERROR. When data is fetched successfully success callback will be invoked. Lagitude, longitude, DIRECTION etc are the properties to be returned.

43.

Which works similar to element?(a) (b) (c) (d) The question was posed to me during an internship interview.Enquiry is from Fonts in HTML topic in division HTML Fonts, Tags and Elements of HTML

Answer»

Right OPTION is (a)

To EXPLAIN: The words written inside can be said with strong EMPHASIS. Browser SHOWS contents written inside element in bold.

44.

All attribute declarations begin with the keyword ____________ followed by the element name, attribute name, attribute type, and default data information.(a) XML(b) SGML(c) ATTLIST(d) HTMLThis question was addressed to me in examination.Question is taken from Reading a Document Type Definition topic in chapter HTML Fonts, Tags and Elements of HTML

Answer»

Correct option is (c) ATTLIST

The explanation is: The ATTLIST DECLARATIONS identify which element types MAY have attributes, what type of attributes they may be, and what the default VALUE of the attributes are. Syntax is<!ATTLISTelementNameattributeNamedataTypedefault >.XML and HTML are web markup language USED to design and create web PAGES. SGML stands for Standard Generalized Markup Language.

45.

The ______________ parameter identifies a character encoding, which is a method of converting a sequence of bytes into a sequence of characters.(a) class(b) element(c) charset(d) attributeI got this question in an interview for job.This key question is from Reading a Document Type Definition topic in portion HTML Fonts, Tags and Elements of HTML

Answer»

The CORRECT choice is (C) charset

To elaborate: Class is an attribute and can be used on any HTML element. Property of an element is defined by attribute. To display an HTML PAGE correctly, a web BROWSER must know the CHARACTER set (character encoding) to use. @charset “UTF-8”; is a string.