ফাংশনের ভিতরের ভেরিয়েবল ফাংশনের বাহিরে কল করা যাবে না । কিন্তু ফাংশনের বাহিরের গ্লোবাল ভেরিয়েবল ফাংশনের ভিতরে ব্যাবহার করা যাবে । এই বিষয়টা কে বলা হয় ভেরিয়েবল স্কোপ ।
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>