Friday 30 January 2015

HTML5 Part5 Interview Questions and Answers

21. What is a Manifest file?
A Manifest file is a simple text file that tells the browser what to cache and what not to cache.
There are three sections of a Manifest file:
i.) CACHE MANIFEST - Files listed here are cached after they are downloaded for the first time.
ii.) NETWORK - Files listed here require a connection to the server, and are never cached
iii.) FALLBACK - Files listed here specify fallback pages if a page is inaccessible

22. What is a Web Worker?
- A web worker is a JavaScript which runs in the background. It exists in external files.
- It is independent of other scripts and does not affect the performance of the page.
- Web workers are usually used for CPU intensive tasks.

23. Which JavaScript objects are not accessible to web worker?
Following JavaScript objects are not accessible to web worker:
•The window object
•The document object
•The parent object

24. What are the new attributes provided in HTML5 for <form>?
The new attributes provided in HTML5 for <form> are:
a.) autocomplete
– It specifies if a form or input field should have autocomplete as on or off.
– If autocomplete is on, the browser is able to fill the values based on the values filled by the user earlier.
– autocomplete works for following input types: text, search, url, tel, email, password, datepickers, range, and color.

b.) novalidate
- This is a boolean attribute.
- When present, it signifies that the form-data should not be validated when submitted.

25. What are the new attributes provided in HTML5 for <input>?
Following are the new attributes provided in HTML5 for <input>
a.) autofocus:
- This is a Boolean attribute.
- When present, it means that an <input> element should automatically get focus when the page is loaded.

b.) form: 
- This attribute specifies one or more forms an <input> element belongs to.

c.) formaction: 
- This attribute specifies the URL of a file that will process the input control when the form is submitted.
- This attribute is used with type="submit" and type="image".
- It overrides the action attribute of the <form> element.

d.) formenctype: 
- This attribute specifies how the form-data should be encoded when submitting it to the server.
- It is used with type="submit" and type="image".
- It overrides the enctype attribute of the <form> element.

e.) formmethod
- It defines the HTTP method for sending form-data to the action URL.
- It is used with type="submit" and type="image".
- It overrides the method attribute of the <form> element.

f.) formnovalidate
- It is a boolean attribute.
- It specifies that the <input> element should not be validated when submitted.
- It is used with type="submit"
- It overrides the novalidate attribute of the <form> element.

g.) formtarget
- It specifies a name or a keyword that indicates where to display the response that is received after submitting the form.
- It is used with type="submit" and type="image".

h.) height and width
- It specifies the height and width of an <input> element.
- It is used only with <input type="image">

i.) list
- It refers to a <datalist> element which contains pre-defined options for an <input> element.

j.) min and max
- It specifies the minimum and maximum value for an <input> element.
- It works with the following input types: number, range, date, datetime, datetime-local, month, time and week.

k.) Multiple
- It is a boolean attribute.
- It specifies that the user is allowed to enter more than one value in the <input> element.
- It works with the following input types: email, and file.

l.) pattern 
- It specifies a regular expression that the <input> element's value is checked against.
- It works with the following input types: text, search, url, tel, email, and password.

m.) placeholder
- It specifies a short hint that describes the expected value of an input field.
- It works with the following input types: text, search, url, tel, email, and password.

n.) required
- It is a boolean attribute.
- It specifies that an input field must be filled out before submitting the form.

o.) step
- It specifies the legal number intervals for an <input> element.
- It works with the following input types: number, range, date, datetime, datetime-local, month, time and week.
More Questions & Answers :-
Part1  Part2  Part3  Part4  Part5  Part6  Part7  Part8  Part9  Part10

No comments:

Post a Comment