Sha256: f31670b9bedc80a2f79c7f4a033b39cdf84adba8bb076f763ffea83a8dac34c3

Contents?: true

Size: 1.55 KB

Versions: 1

Compression:

Stored size: 1.55 KB

Contents

<script type="text/javascript">
    function unhide() {
        document.getElementById("conditional").style.display="block";
    }

    function hide() {
        document.getElementById("conditional").style.display="none";
    }
      
    function addDiv() {
        var button = document.createElement("input");
        button.setAttribute("type", "button");
        button.setAttribute("value", "Newly Created Button");
        button.setAttribute("id", "new_button");
        //document.body.appendChild(button);
        var sectional = document.getElementById("created")
        sectional.appendChild(button);
    }

    function removeDiv() {
        var button = document.getElementById("new_button");
        //document.body.removeChild(button);
        var sectional = document.getElementById("created")
        sectional.removeChild(button);
    }
</script>

<section id="test_events">
    <h2>Simple Events Page</h2>
    
    <div class="group">
        <input type="button" id="conditional" value="Conditional Button"/><br /><br />
        <input type="button" onclick="setTimeout(function() {hide();}, 2000);" value="Hide Button"/>
        <input type="button" onclick="setTimeout(function() {unhide();}, 2000);" value="Reveal Button"/>
    </div>
    
    <div class="group">
        <input type="button" onclick="setTimeout(function() {addDiv();}, 2000);" value="Create Button"/>
        <input type="button" onclick="setTimeout(function() {removeDiv();}, 2000);" value="Remove Button"/>
        
        <div id="created">        
        </div>
    </div>
</section>

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
symbiont-0.1.1 app/views/test_events.erb