document.getElementById('input').innerHTML = "Thowfiqur Rahman Chowdhury";

If we want to print some thing by clicking onto a button by javascript what can we do?? Now have a look....

At first we have to choose a div by 'id' and have to create a function() and a button with 'onclick' option.
We will use the function into 'onclick' option. Let see how it be done??

<scirpt>
             function trc(){
                document.getElementById('input').innerHTML = "Thowfiqur Rahman Chowdhury";
            }
</script>

 <body>
             <div id="input"></div>
             <button onclick="trc()">trc</button>

</body>

Comments

Popular posts from this blog

Deploy laravel application to digital ocean droplet

WP register_post_type() with custom CMB2 meta box

Git post receive setup at server for git push to the production from local machine