Skip to content

Instantly share code, notes, and snippets.

@zephiransas
Created June 7, 2013 04:04
Show Gist options
  • Save zephiransas/5726998 to your computer and use it in GitHub Desktop.
Save zephiransas/5726998 to your computer and use it in GitHub Desktop.
<html>
<head>
<script type="text/javascript">
function toggle_button(id) {
var obj = document.getElementById(id);
obj.style.display = obj.style.display == "none" ? "" : "none";
}
</script>
</head>
<body>
<div>
<span>
<input type="button" id="btn1" value="button1" onclick="toggle_button('text1')"/>
<input type="text" id="text1" value="" style="display:none"/>
</span>
</div>
<div>
<span>
<input type="button" id="btn2" value="button2" onclick="toggle_button('text2')"/>
<input type="text" id="text2" value="" style="display:none"/>
</span>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment