HTML Questions & Answers – Working with Forms & Minification

This set of HTML Multiple Choice Questions & Answers (MCQs) focuses on “Working with Forms & Minification”.

1. Which of the following is not the form type for adding text?
a) Text input
b) Text area
c) Password input
d) Submit button
View Answer

Answer: d
Explanation: There are many types of form controls. Adding text, Submitting forms, Making choices and Uploading files are some of them. For an adding text, we can use Text input, Text area, and Password input. For making choices there are checkboxes, radio buttons, and drop-down boxes.

2. In the processing of information, the server does not use the language _____
a) C#
b) JAVA
c) C++
d) VB.net
View Answer

Answer: c
Explanation: When we enter a new value through form it goes to the server for processing information and this information is processed using languages C#, PHP, JAVA or VB.net. The database can also store the information.

3. For creating single line text box for searching queries, we use the type ___________
a) placeholder
b) search
c) url
d) hidden
View Answer

Answer: b
Explanation: For creating a single line text box for searching queries we use the type=”search”. In old browsers, it will be simply a single line text box. Safari adds across that clear search box when we enter new data to search. It also rounds the corners on search input fields by default.
advertisement
advertisement

4. Form validation traditionally was performed by ___________
a) PHP
b) HTML
c) JavaScript
d) jQuery
View Answer

Answer: c
Explanation: Form validation is checking if the form has been filled correctly. Traditionally it has been performed by JavaScript but now HTML5 is introducing validation. Hence browser does all the work of validation. Validation reduces the amount of work for the server.

5. For grouping form controls we can use ___________
a) <legend>
b) <fieldset>
c) <label>
d) <select>
View Answer

Answer: b
Explanation: For grouping form controls together we use <fieldset> element. Fieldset is shown with a line around edge. Appearance can be adjusted by CSS.

Sanfoundry Certification Contest of the Month is Live. 100+ Subjects. Participate Now!
 E.g. <fieldset> <legend> details </legend> <label> Name: <br/> <>input type=”text” name=”name”/> </label> <br/> </fieldset>

advertisement

6. Which one has the most potential for minification?
a) JavaScript
b) CSS
c) HTML
d) PHP
View Answer

Answer: a
Explanation: Among the four languages JavaScript, PHP, HTML and CSS, JavaScript has the most potential for minification. In JavaScript whitespaces and comments are removed. Windows-style line breaks (CRLF) is converted to UNIX-style breaks (LF). Moreover, variable names can also be shortened.

7. YUI compressor is written in ____________
a) HTML
b) C++
c) C
d) Java
View Answer

Answer: d
Explanation: YUI compressor is one of the best compressor. It is a command-line minifier which is written in Java. It can process CSS as well as JavaScript. It is simple to run it like-

advertisement
$java –jar /usr/local/bin//yuicompressor-2.3.5/build/yuicompressor-2.3.5.jar input.js > output.js

8. Which compressor gives maximum GZIPPED compression?
a) YUI
b) JSMin
c) Packer
d) Closure(advanced)
View Answer

Answer: a
Explanation: YUI compressor gives maximum GZIPPED compression i.e. 21 out of 122. JSMin gives 23 out of 122, Closure(simple) gives 21 out of 122, Closure(advanced) gives 18 out of 122, Packer gives 23 out of 122. There is also redundancy due to GZIP compression.

9. CSSMin is written in ___________
a) C++
b) Java
c) PHP
d) C
View Answer

Answer: b
Explanation: CSSMin is written in Java. It preforms conversion of lowercase, ordering of properties, replacement of names with numeric or hex equivalents. E.g. font-weight:bold can be written as font-weight: 600, color: black to color: #000.

10. HTMLMinifier is written in ________
a) JavaScript
b) Java
c) C++
d) C
View Answer

Answer: a
Explanation: There are mainly two popular HTML minifier. HTMLMinifier and htmlcompressor first are written in JavaScript. It is to be run via a web browser. Second is command-line Java application. HTMLMinifier offers better levels of compression.

11. Which option is not available in HTMLMinifier?
a) remove attribute quotes
b) use the short doctype
c) remove empty elements
d) replace <strong> with <b>
View Answer

Answer: d
Explanation: There are many options available in HTMLMinifier like it removes comments, also comments from CSS and JavaScript blocks, collapses whitespace, removes character data blocks from JavaScript and CSS, Collapses Boolean attributes, removes redundant attributes, uses a short doctype, removes empty elements, removes attribute quotes.

Sanfoundry Global Education & Learning Series – HTML.

To practice all areas of HTML, here is complete set of 1000+ Multiple Choice Questions and Answers.

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.