Posts

Javascript Array

var abc = {                 x: "X",                 y: "Y",                 z: "Z"             };             alert(abc.x);

✖ works really well. The HTML code is ✖

✖

javascript_substring

            var hkc = "bangladesh";             var kc = hkc.substring(6,10);             alert(kc);

javascript variable scope

ফাংশনের ভিতরের ভেরিয়েবল ফাংশনের বাহিরে কল করা যাবে না । কিন্তু ফাংশনের বাহিরের গ্লোবাল ভেরিয়েবল ফাংশনের ভিতরে ব্যাবহার করা যাবে । এই বিষয়টা কে বলা হয় ভেরিয়েবল স্কোপ ।

onclick & onblur

function change_color(ID){             document.getElementById(ID).style.border = "1px red solid";         }         function remove_color(ID){             document.getElementById(ID).style.border = "1px gray solid";         }

window.location

<button onclick="window.location='//www.google.com'">Click to GooGle</button> <select onchange="window.location=this.value">     <option value="http://www.facebook.com/asif24hours">Asif</option>     <option value="http://www.facebook.com/fahim24hours">Fahim</option>     <option value="http://www.facebook.com/nafis24hours">Nafis</option> </select>

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>