multiple underscores randomly in a string :     /*I want random multiple underscores everytime I refresh the page in a string...*/
enter code here
    <html>
    <body>
    <p id="demo"></p>
    <p id="temo"></p>
    <p id="jemo"></p>
    <p id="remo"></p>
    <script>
    var i;
    var x="Sachin Tendulkar";//String in which i want underscores
    var res=x.split("");
    for(i=1;i<=7;i++)//here in this for loop i generated random numbers and accessing the elements at that indexes and try to put underscores there.
    {
    var j=document.getElementById("demo").innerHTML=Math.floor(Math.random()*         ((x.length-1)/2));
    var t=res[j];
    var f=document.getElementById("jemo").innerHTML=x.replace(res[j],"_");
    var l=document.getElementById("jemo").innerHTML=f.replace(res[j],"_");

    }
    </script>
    </body>
    </html>