JavaScript Questions & Answers – Image Map

This set of Javascript Multiple Choice Questions & Answers (MCQs) focuses on “Image Map”.

1. Which side of the image map can be created using JavaScript?
a) Server side
b) Client side
c) Both Server and Client side
d) User side
View Answer

Answer: b
Explanation: Javascript is used for the creation of client side data. You can use JavaScript to create client side image map.

2. Which is the attribute used to enable the Client-side image map?
a) map
b) area
c) usemap
d) areamap
View Answer

Answer: c
Explanation: The usemap attribute is associated with a <map> element’s name or id attribute, and creates a relationship between the <img> and the <map>.

3. Which are the special tags used for image mapping?
a) map and area
b) map and usemap
c) only map
d) only usemap
View Answer

Answer: a
Explanation: The usemap attribute specifies an image (or an object) as an image-map (an image-map is an image with clickable areas). The special tags used for image mapping are map and area.
advertisement
advertisement

4. Which is the element that follows the use of “img”?
a) area
b) usemap
c) map
d) any element can follow the use of “img”
View Answer

Answer: c
Explanation: The usemap attribute is associated with a <map> element’s name or id attribute, and creates a relationship between the <img> and the <map>. The “map” element actually creates the map for the image and usually follows directly after the “img ” element.

5. What is the purpose of the area element?
a) Area of the text
b) Shape and coordinates of the hotspot
c) Shape and area of the hotspot
d) Coordinates and area
View Answer

Answer: b
Explanation: The <area> tag defines an area inside an image-map (an image-map is an image with clickable areas). The <area> element is always nested inside a <map> tag. The area element specifies the shape and the coordinates that define the boundaries of each clickable hotspot.
Sanfoundry Certification Contest of the Month is Live. 100+ Subjects. Participate Now!

6. Which of the following is not a navigator property?
a) platform[]
b) plugin[]
c) userAgent[]
d) browser[]
View Answer

Answer: d
Explanation: The navigator object contains information about the browser. All of the above mentioned are the properties of a navigator.

7. What is the purpose of the platform[] property in a navigator?
a) Platform of the script
b) Platform where the image map was designed
c) Platform where the browser was compiled
d) Platform where the plugin was designed
View Answer

Answer: c
Explanation: The platform[] property is a string that contains the platform for which the browser was compiled. “Win32” for 32-bit Windows operating systems.
advertisement

8. What is the purpose of the preference method in a navigator?
a) Set Browser preference
b) Set Netscape preference
c) Both Set Browser & Netscape preference
d) Sets user preference
View Answer

Answer: b
Explanation: The preference(name,value) method allows a signed script to get and set some Netscape preferences. If the second parameter is omitted, this method will return the value of the specified preference; otherwise, it sets the value Netscape only.

9. Which of the following is not a navigator method?
a) postEnabled
b) reference
c) preference
d) postreference
View Answer

Answer: c
Explanation: The preference(name, value) method allows a signed script to get and set some Netscape preferences. If the second parameter is omitted, this method will return the value of the specified preference; otherwise, it sets the value Netscape only.
advertisement

10. What is the purpose of the userAgent property?
a) Identifying the data
b) Identifying the client
c) Both Identifying the data and client
d) Identifying the dataset
View Answer

Answer: b
Explanation: The userAgent[] property is a string that contains the code name and version of the browser. This value is sent to the originating server to identify the client. The userAgent property returns the value of the user-agent header sent by the browser to the server.

Sanfoundry Global Education & Learning Series – Javascript Programming.

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.