Html5 Interview Questions and Answers

What is the difference between soap and rest?

Soap is a web development protocol while Rest is a architectural platform

Soap works with xml

Rest works with xml , html and plain text

Soap cannot use Rest, Rest can make use of Soap

What is the use of namespace in web development?

A namespace is a simple global object that is used to hold methods, properties and other objects in them. It adds ease to use via modularity, thereby providing users with the ability to reuse code and avoid naming conflicts

What are the newly introduced input types in html5?

html5 has many newly introduced input types, few of them are email, time, date, password, number,color, month, datetime local etc. These new input types are easy to use

What are the form elements that support media content?

  • source
  • audio
  • video
  • track
  • embed

What is svg and why it is used??

SVG stands for scalable vector graphics, svg images are high quality images , the graphical content is also rendered high quality, it is used to display vector based graphics over the web. the graphical content rendered by svg is xml format

What is the use of canvas??

easy and powerful way to draw diagrams in html. using canvas element we can draw the graphics by writing the javascript. we can draw different shapes like paths, graphs, circles, boxes, images and more and animate the graphics, create animations etc

How can page loading time be reduced?

There are many methods by using which we can reduce page loading time of a website

  • low image sizes
  • avoiding unnecessary codes
  • http compression
  • reduction in lookups
  • avoiding redirection and caching

What is cors?

cors stands for cross origin resource sharing

it is the mechanism to allow the variety of access to the resources from one requested domain to the number of resources from other domains which are outside of the requested domain. This mechanism works as a binding bridge to get the requested resources from non current working domain

What is the difference between cookies and local storage?

cookie data is accessible for both the client and the server

cookie has an expiry time and data gets deleted after the expiry time

in local storage data is stored only on the local browser in the client machine, there is no expiry in the local storage unless the data is manually deleted

What is the difference between xhtml and html?

the tags in xhtml must be in lowercase where as in html it is case sensitive

the attributes in xhtml must be enclosed in double quotes where as in the html you can have attributes in single quotes also and can also be without quotation marks. tags must be closed once opened where as in html tags can be self closed

What is difference between b element and strong element?

b element is old way of making text bold which does not have semantic meaning, strong is added in html5 specification and has semantic meaning that the text is strong look and having strong meaning

What goes inside the head element?

content inside the head element describes about the document, like character set, description, title, css references, javascript references and more

What is semantic html means??

Semantic html elements means, certain elements has some meaning and purpose attached to them

semantic html helps in seo, search engines will understand the structure of our content, writing semantic html is extremely important for accessibility, specially people who rely on screen readers