Showing posts with label Frequently Asked html5 interview questions and answers pdf. Show all posts
Showing posts with label Frequently Asked html5 interview questions and answers pdf. Show all posts

50 Helpful HTML & HTML5 Interview Questions & 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.

26. What’s new HTML 5 DocType and Charset?

As HTML 5 is now not subset of SGML so its DocType is simplified as follows:
                  <!doctype html>
And HTML 5 uses UTF-8 encoding as follows:
                 <meta charset=”UTF-8?>

27. How can we embed Audio in HTML 5?

HTML 5 comes with a standard way of embedding audio files. Supported audio formats are MP3, Wav and Ogg.

<audio controls>
    <source src=”jamshed.mp3? type=”audio/mpeg”>
    Your browser does’nt support audio embedding feature.
</audio>

28. How can we embed Video in HTML 5?

Same like audio, HTML 5 defined standard way of embedding video files.Supported video formats are MP4, WebM and Ogg.

<video width=”450? height=”340? controls>
  <source src=”jamshed.mp4? type=”video/mp4?>
   Your browser does’nt support video embedding feature.
</video>

29. What are the new media element in HTML 5 other than audio and video?
HTML 5 has strong support for media. Other than audio and video tags, it comes with the following tags:
<embed> acts as a container for external application.
<track> defines text track for media.
<source> is helpful for multiple media sources for audio and video.

30. What are the different types of storage in HTML 5?

HTML 5 has the capability to store data locally. Previously it was done with the help of cookies.
Exciting thing about this storage is that its fast as well as secure.

There are two different objects which can be used to store data.

localStorage object stores data for a longer period of time even if the browser is closed.
sessionStorage object stores data for a specific session.

Read More Questions:
HTML5 Interview Questions Part1
HTML5 Interview Questions Part2
HTML5 Interview Questions Part3
HTML5 Interview Questions Part4
HTML5 Interview Questions Part5