I am do the auto click checkbox on the image. When user click on the image, the checkbox while be autoclick by one, and the second time click, second checkbox will be auto click and etc.
[CODE]
var ini=1;
function check()
{
ini++;
var i=1, c;
while(c=document.getElementsByName(‘checkbox[]’)){
i<=ini?c.checked=true:null;
}
<div>
<img src=”sun2_.jpg” onClick=”check();”/>
</div>
<?php
for($j=1; $j<24; $j++){
for($i=1; $i<13; $i++){
?>
<input type=”checkbox” name=”checkbox[]”/>
<?php
}
}
?>
Can anyone guide me to the right way? Because the JavaScript code not running as i expected i.e when i click on the image, nothing happened.
Any help would appreciate.