Javascript Form How to - Show hidden button








Question

We would like to know how to show hidden button.

Answer


<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
<script>
function showButtons () { $('#b1, #b2, #b3').show(); }
</script><!--   w  ww.  j ava 2 s .  c  o m-->
<style type="text/css">
#b1, #b2, #b3 {
    display: none;
}
</style>
</head>
<body>
    
    <a href="#" onclick="showButtons();">Show me!</a>
    
    <input type="submit" id="b1" value="B1" />
    <input type="submit" id="b2" value="B2"/>
    <input type="submit" id="b3" value="B3" />

</body>
</html>

The code above is rendered as follows: