Created
July 3, 2013 09:45
-
-
Save jswhisperer/5916703 to your computer and use it in GitHub Desktop.
inline js for show and toggle element by id. Use case, feature phone Opera Mini.
This file contains hidden or 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
| <script> | |
| function toggle_visibility(id) { | |
| var e = document.getElementById(id); | |
| if(e.style.display == 'block') | |
| e.style.display = 'none'; | |
| else | |
| e.style.display = 'block'; | |
| } | |
| function show(id) { | |
| var e = document.getElementById(id); | |
| e.style.display = 'block'; | |
| } | |
| </script> | |
| <a href="#" onclick="toggle_visibility('text');">Show me!</a> | |
| <p style="display:none;" id="text"> | |
| I'm Hidden | |
| </p> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment