HTML Tips and Tricks

HTML Tips, HTML Tricks, HTML Tweaks

Disable right clicking on page

This trick disables the right click on your web page . It is tested on IE and works fine.. Here is the code:
<SCRIPT language=”JavaScript”>
<!–
var message=”Put here the text you want to display when you right click”;
function click(e) {
if (document.all) {
if (event.button==2||event.button==3) {
alert(message);
return false;
}
}
if (document.layers) {
if (e.which == 3) {
alert(message);
return false;
}
}
}
if (document.layers) {
document.captureEvents(Event.MOUSEDOWN);
}
document.onmousedown=click;
// –>
</SCRIPT>
[...]

Links without underline

Links without underline, get rid of underline in links
Put this code and get rid of underline:
<a href=”your link here” style=”text-decoration:none”> This is a link</a>

For Example:
<a href=”http://www.computereducationworld.com” style=”text-decoration:none”> Excellent site</a>
It will look like this:
Excellent site

change background of table on mouseover

change background of table on mouseover
This is very cool trick to change background color of table when you takeover the mouse pointer over it.
Place the following code within the
or tag of your HTML
onMouseover=”this.bgColor=’#EEEEEE’”onMouseout=”this.bgColor=’#FFFFFF’”
For example:
<table border=”2″ cellpadding=”2″ width=”100%”>
<tbody>
<tr onmouseover=”this.bgColor=’#669900′” onmouseout=”this.bgColor=’#FFFFFF’”>
<td>www.Computereducationworld.com</td>
</tr>
<tr onmouseover=”this.bgColor=’#669900′” onmouseout=”this.bgColor=’#FFFFFF’”>
<td>www.Computereducationworld.com</td>
</tr>
<tr onmouseover=”this.bgColor=’#669900′” onmouseout=”this.bgColor=’#FFFFFF’”>
<td>www.Computereducationworld.com</td>
</tr>
</tbody></table>
It will look like this:

www.Computereducationworld.com

www.Computereducationworld.com

www.Computereducationworld.com