HTML 5 Interview Questions and Answers (188) - Page 4

Can we have a nested list in HTML? If so explain with an example.

Yes we can have as many nested lists in HTML.
Let us see an example of the same.

Example:

<html> <body>
<h4>Computer Programming Languages:</h4>
<ul>
<li>Low Level Languages
<ul>
<li> Machine language </li>
<li> Assembly language </li>
</ul>
</li>
<li>High Level Languages
<ul>
<li>Algebraic formula type processing</li>
<ul>
<li>BASIC</li>
<li>FORTRAN</li>
</ul>
<li>Business Data processing
<ul>
<li>COBOL</li>
<li>RPG</li>
</ul>
</li>
<li>String and List processing
<ul>
<li>LISP</li>
<li>Prolog</li>
</ul>
</li>
<li>Object oriented programming
<ul>
<li>C++</li>
<li>Java</li>
</ul>
</li>
<li>Visual programming
<ul>
<li> Visual C++</li>
<li>Visual Basic</li>
</ul>
</li>
</ul>
</li>
</ul>
</body>
</html>

What is the use of <noscript> tag in HTML?

The <noscript> tag is used to display some text to the user when the Java script is not supported by the browsers.

Example:
<html>

<body>
<script type="text/javascript">
document.write("Hello World!")
</script>
<noscript>Sorry, your browser does not support JavaScript!</noscript>
</body>
</html>

How to insert a script in HTML?

Let us see a small "Hello World" java script example.

<html>
<body>
<script type="text/javascript">
document.write("Hello World!")
</script>
</body>
</html>

How to redirect an user with a URL in HTML?

The <meta> tag with "http-equiv" and "content" attribute is used to redirect an user automatically to a website.

Let us see an example with dotnetfunda site.

<html>

<head>
<meta http-equiv="Refresh" content="5;url=http://www.dotnetfunda.com" />
</head>
<body>
<h1>Sorry! We have moved!</h1>
<h2>The new URL is: <a href="http://www.dotnetfunda.com">http://www.dotnetfunda.com</a></h2>
<p>You will be redirected to the new address in five seconds.</p>
<p>If you see this message for more than 5 seconds, please click on the link above!</p>
</body>
</html>

How to display a dropdown list with a selected value?

<html>

<body>
<form action="">
<select name="Programming Languages">
<option value="vb">VB</option>
<option value="java">Java</option>
<option value="dotnet" selected="selected">.NET</option>
<option value="c">C</option>
</select>
</form>
</body>
/html>

What is geolocation in html5 ? give a real time example which you had come across ?

Geolocation in html5 is used to get the Latitude and Longitude values . By using these values we can find the exact location of the user . The gelocation is mostly used in the social networking sites . The Mobile social networking site Gorilla also uses geolocation and facebook also uses the geolocation when we access the facebook using mobile then automatically we will it will show our location .
What is Zen Coding ?

Zen Coding is an editor plugin for high-speed HTML, XML, XSL (or any other structured code format) coding and editing.

The core of this plugin is a powerful abbreviation engine which allows you to expand expressions—similar to CSS selectors—into HTML code. In other word, you can say A faster way to write HTML way to write HTML using a CSS style selector syntax.

Now, you can it in Visual Studio 2012 via the Web Essentials 2012 plug in (v1.7).
It become a great way to write monotonous HTML much more efficiently.

e.g:

div#page>div.logo+ul#navigation>li*5>a
..can be expanded into:

<div id="page">
<div class="logo"></div>
<ul id="navigation">
<li><a href=""></a></li>
<li><a href=""></a></li>
<li><a href=""></a></li>
<li><a href=""></a></li>
<li><a href=""></a></li>
</ul>
</div>
What is Websocket API in html5 ?

It is a technology designed to simplify much of the complexity around bi-directional , full duplex communication channels, over a single TCP socket.

It can be implemented in web browsers, web servers as well as used by any client or server application.

It is currently being standardized by the W3C web application working group.
What is Canvas ?

It is a Pixel based (resolutin dependent) API that enables you to dynamically generate and render charts, grphics and animation (without use of flash or silverLight).

It is similar to tags like <div>,<a> and <table> tag, except that its contents are rendered with Javascript. It it also support fallback content means if browser that does not support the this element, you can provide an alternative image or some text what user could be enjoying.
What is Web Storage?

Its a new HTML5 API offering important benefits for storing data in a web browser. It is more secure and faster. The data is stored in key/value pairs.

It offers two different storage areas

1) Local storage - Data placed in local storage is per domain and persists after the browser is closed.

2) Session storage- Data placed in session storage is for one session.(within the browser tab or window session)
How many different ways you can stop web worker ?

There are two ways to stop a worker: by calling worker.terminate() from the main page (e.g: .html,.aspx,.php page etc) or by calling self.close() inside of the worker itself(e.g: .js page).
What are the limitations of the web worker ?

Web worker don't access following things

1.The DOM (it's not thread-safe)
2.The window object (few read-only exception (e.g: location object)
3.Host Page (The parent object)
Which javascript objects are access by the web worker ?

Due to their multi-threaded behavior, web workers only has access to a following few of JavaScript's features:


1. The navigator object
2.XMLHttpRequest
3. setTimeout() and clearTimeout()
4. setInterval()/clearInterval()
5. The Application Cache
6.the importScripts() method
Canvas in HTML 5.0 belong to?

NOTE: This is objective type question, Please click question title for correct answer.
Transformations are applied in HTML 5 by using

NOTE: This is objective type question, Please click question title for correct answer.
Does HTML 5 support which format to play the video?

NOTE: This is objective type question, Please click question title for correct answer.
How to display a computer code in html

In order to display computer code in Html, we need to use code block.
Ex:
<code>

DotNetFunda.Com is a popular online tutorials and guide
for latest Microsoft® technologies aimed for beginners and
intermediate level professionals. We help beginners to
become intermediate level professionals and help intermediate
level professionals to become an expert.
</code>

In HTML5,how to set compatibility modes?

If we declare our HTML doctype header in the HTML5 standard,then IE is smart enough to know that it should emulate IE9+ without needing a meta tag to tell it what to do.In this case,start your page with the following header tag.There is no need to add meta tag.
Just add doctype tag at the top of the ASPX page as shown:-
<!doctype html>

In the html page how do we display a sub window ?

In case we want to display a sub-window we should use iframe.
In this iframe describes aboutWidth and Height properties of the iframe and is used to specify the width and height of the sub window. Src property is used to specify the html page that should be displayed in the sub window. frame1.htm

Note:we should write this code with in the body

Example:
iframe.htm(main page)

<p>This text is in the main page.</p>
<iframe src="frame1.htm" width="500" height="200" frameborder="0"></iframe>
<p>This text is in the main page.</p>

<body style="background-color:yellow">
<p>This text is in iframe page</p>
</body>

Found this useful, bookmark this page to the blog or social networking websites. Page copy protected against web site content infringement by Copyscape

 Interview Questions and Answers Categories