মাল্টি লাইন মন্তব্য (Multi line comments) |জাভাস্ক্রিপ্ট বাংলা টিউটোরিয়াল

মাল্টি লাইন মন্তব্য (Multi line comments)

সাধারণত প্রোগ্রামের শুরুতে অথবা কোন ফাংশনের শুরুতে সে সম্পর্কিত বিস্তারিত তথ্য উপস্থাপনের প্রয়োজন হয়, আর এ ক্ষেত্রে মাল্টি লাইন মন্তব্য ব্যবহার করা হয়। এজন্য মন্তব্য এর শুরু নির্দেশ করার জন্য /* স্লাস এবং স্টার চিহ্ন এর পর মন্তব্য এবং শেষে  স্টার চিহ্ন এবং স্লাস */ ব্যবহার করা হয়। অর্থাৎ /* This is an example of multi line comment. This is the second line of this comment.*/ এর অনুরূপ মাল্টি লাইন মন্তব্য যুক্ত করা হয়।

জাভাস্ক্রিপ্টে লেখা মন্তব্য যুক্ত একটি প্রোগ্রাম

<html>
<head>
<title> www.tutohost.com</title>
<style>
body{background: #FFC;
font-size:24px;}
</style>

</head>
<body>
<script type = "text/javascript">
/* When the page will load it show "Good morning" in a alart box . The page will show It is morning.You should learn JavaScript now.Visit www.tutorialbd.com and start to learn JavaScript.*/
alert("Good morning");
document.write("It is morning.");
document.write("You should learn JavaScript now.");
document.write("Visit www.tutorialbd.com and start to learn JavaScript.");
</script>
</body>

</html>

একটা নোটপ্যাড open করে উপরের code টুকু লিখে file মেনু থেকে Save as এ ক্লিক করে File name: index.html , Save as type : All files, দিয়ে save করে index.html ফাইলটি Mozilla Firefox দিয়ে open করলে নিচে প্রদর্শিত ছবির মত দেখাবে।



উপরের প্রোগ্রামটিতে /*   */ এর পরে লেখা When the page will load  it show "Good morning" in a alart box . The page will show It is morning.You should learn JavaScript now.Visit www.tutorialbd.com and start to learn JavaScript.ব্রাউজারে প্রদর্শিত হচ্ছে না। করণ এটা একটা মাল্টি লাইন মন্তব্য।

লেখকঃ অসীম কুমার
তিনি ইলেকট্রিক্যাল ইঞ্জিনিয়ারিং এ লেখাপড়া করছেন। টিউটোরিয়ালবিডি ও বিজ্ঞানপ্রযুক্তি ব্লগে তিনি ইলেক্ট্রনিক্স সহ বিভিন্ন টেকনোলজি বিষয়ে লিখে থাকেন। বর্তমানে তিনি লেখাপড়ার পাশাপাশি টিউটোহোস্টে কর্মরত আছেন।

কপি রাইট © ২০১১থেকে যত দিন চলবে