Jump to content

really Need help


salhzmzm

Recommended Posts

hi

I have a little problem with this code.

so mybe you can help me.

 

function do() {
if (document.getElementById('MyId').style.display='none' {
document.getElementById('MyId').style.display='' ;
else {
document.getElementById('MyId').style.display='none' ;

}
}
}

 

in the html page I type

 

<table id='mytable'>
<tr>
<td>sfsdfsdf</td>
<tr>
</table>
<a href='#' onclick='do()'>hide/show</a>

 

so please help me.

Link to comment
https://forums.phpfreaks.com/topic/86547-really-need-help/
Share on other sites

<script language="javascript">
function doIt() {
var myTable = document.getElementById('MyId').style.display;
if (myTable == "none") {
document.getElementById('MyId').style.display='block' ;
}
else {
document.getElementById('MyId').style.display='none' ;
}
}
</script>

<table id='MyId'>
<tr>
<td>sfsdfsdf</td>
<tr>
</table>
<a href='#' onclick='doIt()'>hide/show</a>

Link to comment
https://forums.phpfreaks.com/topic/86547-really-need-help/#findComment-442262
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.