Jaydeepsinh Jadeja
Jaydeepsinh Jadeja

Reputation: 391

how to check all check boxes which shown throgh for loop?

I want to check all the check boxes which are in div tag My code is as below.

<div id="cBoxes">
<li><input class="radio" name="list" id="list" type="checkbox" 
     value="<?php echo $resultPages['id'];?>"></li>
</div>

I have put this whole code in for loop with php tag. Is there any way to accomplish this task.

Upvotes: 0

Views: 109

Answers (2)

topp
topp

Reputation: 150

See the checked attribute:

<div id="cBoxes">
<ul>
<li><input class="radio" name="list" id="list" type="checkbox" 
     value="<?php echo $resultPages['id'];?>" checked="checked"/></li>
</ul>
</div>

Upvotes: 2

Vikas
Vikas

Reputation: 8948

Set the checked attribute of checkbox. w3.org has complete documentation.

Upvotes: 2

Related Questions