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>
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
Post a Comment