Learn free online HTML5, javascript, and jquery Tutorials by Examples

Wednesday, 18 June 2014

Change background color dynamically with JavaScript

---------------------------------------------------------
<input type="text" placeholder="plz enter color code" id="change" />
<input type="button" value="click" id="clik" onclick="changeme()" />

<script>
    function changeme(){
    var this_ = document.getElementById('change').value;
        document.bgColor = this_;
    }
</script>
--------------------------------------------------------

No comments:

Post a Comment