php - using a div as a radio button -


<div>     <table class='accor'>         <tr>             <td>roll no.</td>             <td>12801</td>         </tr>         <tr>             <td>name</td>             <td>xxxx</td>         </tr>         <tr>             <td>class</td>             <td>ms</td>         </tr>     </table> </div> 

i want above code radio button. above code running inside php while loop data supplied database. (i need use checked=checked match predefined value.) using jquery ui buttonset style radio.

how can achieve that?

$().buttonset takes input type='radio' elements inside selector , makes stylized button set out of them. each of these elements, associated label placed on display of resulting button. have buttons labels aren't single line of text, place contents inside label.

<form>   <div id="radio">     <input type="radio" id="radio1" name="radio" />       <label for="radio1">         <div>           <table class='accor'>             <tr>               <td>roll no.</td>               <td>12801</td>             </tr>             <tr>               <td>name</td>               <td>xxxx</td>             </tr>           </table>         </div>       </label>       <input type="radio" id="radio2" name="radio" checked="checked" />       <label for="radio2"><div>         <table class='accor'>           <tr>             <td>roll no.</td>             <td>12801</td>           </tr>           <tr>             <td>name</td>             <td>xxxx</td>           </tr>         </table>       </div>     </label>   </div> </form> 

js:

$(function() {     $("#radio").buttonset(); }); 

Popular posts from this blog

php - How should I create my API for mobile applications (Needs Authentication) -

5 Reasons to Blog Anonymously (and 5 Reasons Not To)

Google AdWords and AdSense - A Dynamic Small Business Marketing Duo