Sha256: 18859322324bc140a9ebf7d001047d7a652d4954923ebe3edb97c1ab60b539a5
Contents?: true
Size: 1.26 KB
Versions: 20
Compression:
Stored size: 1.26 KB
Contents
<html> <head> <title>Test Hidden Message</title> <style type="text/css"> div.hide { display: none; margin-left: auto; margin-right: auto; } div.show { display: block; margin-left: auto; margin-right: auto; } #Container { background-color: #f00; color: #fff; width: 300px; height: 300px; padding-top: 100px; text-align: center; font: bold 2em Verdana, Helvetica, sans-serif; } </style> <script type="text/javascript"> function show(divId) { var divContainer = document.getElementById("Container"); var divArr = divContainer.getElementsByTagName("div"); for (var i = 0; i < divArr.length; i++) { if ( divArr[i].id == divId ) { divArr[i].className = "show"; } else { divArr[i].className = "hide"; } } } </script> </head> <body> <div id="Container"> <div id="successError" class="hide">Success!</div><div id="failureError" class="hide">Failure!</div> </div> <form style="width: 300px; text-align: center;"> <p>Click on a button to display a message.</p> <input type="button" name="success" value="Success" onclick="show( this.name + 'Error' );" /> <input type="button" name="failure" value="Failure" onclick="show( this.name + 'Error' );" /> </form> </body> </html>
Version data entries
20 entries across 20 versions & 1 rubygems