Prev Next

HTML / HTML Interview questions


How will you disable all the html elements within a HTML Table?


When does a body onLoad gets called/executed?


How will you enable all the html elements within an html table?


Difference between <div> and <span> element.

<div> is a block level element and it helps to group html elements.

<span> is an inline element and it also helps in grouping html elements.

How to display &lt; and &gt; using html without transforming it to & and >?

Escape the & using &amp;.

Change this

<h1>&lt;test-Link &gt;</h1>

To the below.

<h1>&amp;lt;test-link &amp;gt;</h1>

How do I invert/transpose the rows and columns of a HTML table?

Save the below content into a file with .html extension and open it in browser.

<script src=""></script>


 $( document ).ready(function() {
$("#tableID").each(function() {
        var $this = $(this);
        var newTransposedRow = [];
            var i = 0;
                if(newTransposedRow[i] === undefined) { newTransposedRow[i] = $("<tr></tr>"); }
        $.each(newTransposedRow, function(){
<table id="tableID">



HTML 5: How do you find the user's location or position?

The HTML Geolocation API is used to get the geographical position of a user.

Since this could possibly compromise user's privacy, the position is not available unless the user approves it.

The getCurrentPosition() method is used to get the user's position.

function getLocation() {
    if (navigator.geolocation) {
    } else {
       alert ("Geolocation is not supported by this browser.");
function showPosition(position) {
    alert( "Latitude: " + position.coords.latitude + 
    "\nLongitude: " + position.coords.longitude); 

<body onload = 'getLocation()'></body>

What are the common CSS pseudo classes for formatting links.
A link that hasn't been visited. Blue is the default color. visited A link that has been visited. Purple is the default color. :hover An element with the mouse hovering over it. Hover has no default color. :focus An element like a link or form control that has the focus. :active An element that's currently active. Red is the default color. The properties for removing underlines and borders
a:link {
 color: green;
a:hover, a:focus {
 text-decoration: none;
 font-size: 110%;
What are the properties for removing underlines and borders of link?

text-decoration : To remove the underlining from a link, set this to none.

border-style: To remove the border from an image link, set this to none. You can also set the border-width property to 0.


Comments & Discussions