Created
June 15, 2012 06:44
-
-
Save anonymous/2935060 to your computer and use it in GitHub Desktop.
JavaScriptとCSSについて質問です。 要素の折りたたみを行いたい.. - 人力検索はてな http://q.hatena.ne.jp/1339739700
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<script type="text/javascript"> | |
function showHide(foldingID) { | |
if( document.getElementById(foldingID)){ | |
if( document.getElementById(foldingID).style.display == "none"){ | |
document.getElementById(foldingID).style.display = "block"; | |
} | |
else{ | |
document.getElementById(foldingID).style.display = "none"; | |
} | |
} | |
} | |
</script> | |
</head> | |
<body> | |
<a href="#" onClick="showHide('test');return false;">test</a> | |
<table> | |
<td>aa</td> | |
<td>bb</td> | |
<div id="test" style="display: none"> | |
<td>cc</td> | |
</div> | |
<td>dd</td> | |
</table> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment