Below is my code.i want the first division should be load when window is loading.
in the above code i want the Home_Content should be default loaded when i running the script.please help me.
Code:
<HTML>
<HEAD>
<script>
function tabFunc(getthis)
{
var getIn=getthis.innerHTML;
var getId=getIn+'_content';
var divId=document.getElementById('content');
var divlen=divId.getElementsByTagName('div');
for (var i=0;i<divlen.length;i++ )
{
if(divlen[i].id != getId)
{
divlen[i].style.display='none';
}
else
{
divlen[i].style.display='block';
}
}
var par=getthis.parentNode;
var mm=par.getElementsByTagName('td');
for(var i=0;i<mm.length-1;i++)
{
if(mm[i]==getthis)
{
mm[i].className='click';
}
else
{
mm[i].className='Normal';
}
}
}
</script>
<style>
.Normal {background-color:#FF0000;cursor:pointer;}
.click {background-color:#FFFFFF;cursor:pointer;}
td{
border:none;
font-family:verdana,arial;
font-size:12px;
}
table{
border:none;
}
</style>
</HEAD>
<BODY>
<table border="0" background="back.gif" height="100%" width="100%">
<tr>
<td>
<table cellspacing="0" cellpadding="0" width="100%" border="2" height="100%">
<tr height="23px">
<td class="Normal" onclick="tabFunc(this);" style="width:50px; background-position:right; padding-left:20px;padding-right:20px;border-left:1px solid #000000;">Home</td>
<td class="Normal" onclick="tabFunc(this);" style="width:50px;background-position:right; padding-left:20px;padding-right:20px;border-left:1px solid #000000;" >Operation</td>
<td class="Normal" onclick="tabFunc(this);" style="width:50px;background-position:right; padding-left:20px;padding-right:20px;border-left:1px solid #000000;" >Administration</td>
<td width="100%" style="border-bottom:1px solid #000000;"> </td>
</tr>
<tr>
<td colspan="4" id="content" style="height:100%;width:100%;border-top:0px;border-left:1px solid #000000;border-bottom:1px solid #000000;border-right:1px solid #000000;">
<div id="Home_content" style="display:none;height:100%;width:100%;border:0px solid #000000;">Home_contentet</div>
<div id="Operation_content" style="display:none;height:100%;width:100%;border:0px solid #000000;">Operation_contentet</div>
<div id="Administration_content" style="display:none;height:100%;width:100%;border:0px solid #000000;">Administration_content</div>
</td>
</tr>
</table>
</td>
</tr>
</table>
</BODY>
</HTML>
Comment