HTML Questions and Answers Part-20

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

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.

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

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.

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

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.

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

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.

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

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.

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

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.

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

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.

8. CSSMin is written in ___________
a) C++
b) Java
c) PHP
d) C

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.

9. HTMLMinifier is written in ________
a) JavaScript
b) Java
c) C++
d) C

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.

10. 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>

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.