<script type="text/javascript">
function hide4d()
{
document.getElementById('4d_div').style.display = 'none';
}
</script>
Is there something wrong with my hide div code, I trying hide this
<div id="4d_div">
some content
some inner div , some inner div close
</div>
and I did this to my tag
<body onLoad="hide4d();">
and nothing happen when my page load.. i just wanna hide the div by default using javascript, and unhide it with a button later.
Edited:
I had this on my
<script type="text/javascript">
document.getElementById('4d_div').style.display = 'none';
</script>
</head>
But the 4d_div is still not hidden. It seems to work fine if i change to nowrap in fiddle
The weird thing is
I inspect element with chrome, the display: none; was added in, but I din't add the close tag there
my code is something like
<div id="4d_div">
<tr><td> </td></tr>
<div id="big_rate_div" class="form-group">
<tr><td width="25%">
<label for="big_rate">Big Rate</label>
</td><td>
<b>1.60</b>
</td></tr>
</div>
<tr><td> </td></tr>
<div id="small_rate_div" class="form-group">
<tr><td width="25%">
<label for="big_rate">Small Rate</label>
</td><td>
<b>0.70</b>
</td></tr>
</div>
<tr><td> </td></tr>
<div id="rebate" class="form-group">
<tr><td width="25%">
<label for="rebate">Rebate</label>
</td><td>
<table>
<tr><td width="30%">
<input type="text" class="form-control" id="ticket_rebate" placeholder="">
</td><td>%</td>
</tr></table>
</td>
</tr>
</div>
<tr><td> </td></tr>
<div id="commission" class="form-group">
<tr><td width="25%">
<label for="commission">Commission</label>
</td><td>
<table>
<tr><td width="30%">
<input type="text" class="form-control" id="commission" placeholder="">
</td>
<td>%</td>
</tr></table>
</td>
</tr>
</div>
</div>
My 4d_div suppose to end at the last tag, but when my page is load, the 4d_div seems individual
it close right after it open , and the div inside it was all wrap by themselves.
Is there any part of my code to make my div unable to wrap the other 4 div , big_rate_div, small_rate_div, rebate and commission