Here I have a code:
<div id="s">STOP</div>
<div id="L1"></div>
<div id="L2"></div>
<div id="L3"></div>
<div id="L4"></div>
<div id="L5"></div>
v=setInterval(function(){for(i=0;i<6;i++){$("#L"+i).html(String.fromCharCode(Math.floor(Math.random()*26+65)))};},500);
$("#s").click(function(){clearInterval(v);});
This code give me a random letter when I click on STOP div
NOW I need to get final letter based on php $a…
<?php
$a=AGHBV;
?>
<div id="s">STOP</div>
<div id="L1"></div>
<div id="L2"></div>
<div id="L3"></div>
<div id="L4"></div>
<div id="L5"></div>
v=setInterval(function(){for(i=0;i<6;i++){$("#L"+i).html(String.fromCharCode(Math.floor(Math.random()*26+65)))};},500);
$("#s").click(function(){clearInterval(v);});
so When I click on STOP I need to change content of L1-A , div L2-G, div L3 – H … … etc.
How I can do that?
I need this for my game (make the biger word)
First you need to make the PHP output
$a = "ABCDE"in the beginning of the JavaScript, such asecho "\$a=\"abcde\";";.Then use the updated script here:
http://jsfiddle.net/Hx28c/3/