Web / HTML Interview questions
$('#tableID').find('select,input,textarea').attr('disabled','disabled');
The load event fires at the end of the document loading process. At this point, all of the objects in the document are in the DOM, and all the images and sub-frames have finished loading.
$('#tableID').find('select,input,textarea').removeAttr('disabled');
<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.
Escape the & using &.
Change this
<h1><test-Link ></h1>
To the below.
<h1>&lt;test-link &gt;</h1>
Save the below content into a file with .html extension and open it in browser.
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.2/jquery.min.js"></script> <html> <head> </head> <script> $( document ).ready(function() { $("#tableID").each(function() { var $this = $(this); var newTransposedRow = []; $this.find("tr").each(function(){ var i = 0; $(this).find("td").each(function(){ i++; if(newTransposedRow[i] === undefined) { newTransposedRow[i] = $("<tr></tr>"); } newTransposedRow[i].append($(this)); }); }); $this.find("tr").remove(); $.each(newTransposedRow, function(){ $this.append(this); }); }); }); </script> <body> <table id="tableID"> <tr> <td>R1C1</td> <td>R1C2</td> <td>R1C3</td> </tr> <tr> <td>R2C1</td> <td>R2C2</td> <td>R2C3</td> </tr> </table> </body> </html>
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.
<html> <head> <script> function getLocation() { if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(showPosition); } else { alert ("Geolocation is not supported by this browser."); } } function showPosition(position) { alert( "Latitude: " + position.coords.latitude + "\nLongitude: " + position.coords.longitude); } </script> </head> <body onload = 'getLocation()'></body> </html>
Name | Description |
:link | . |
a:link { color: green; } a:hover, a:focus { text-decoration: none; font-size: 110%; }
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.