jquery - Make div work like a check box -


i have list of color names check boxes. instead of having check boxes there, able select entire div title in it. checked div's understood different background color.

my html , erb file , contains ruby. want <%= color.name %> inside "idea[color_ids][]" id div. when try putting them inside each other rails error

html/erb file

  <ul class="multi-column-checkbox">         <% color in color.master_colors %>             <li><%= check_box_tag "idea[color_ids][]", color.id,    @idea.colors.include?(color) %> <%= color.name %></li>         <% end %>       </ul> 

how can color.names inside "idea[color_ids][]" div instead of inside li div? can select entire "idea[color_ids][]" (with color name title inside)?

you try this:

<label for="check1">   <input type="checkbox" name="check" id="check1" /> testing </label> 

then either treat label div or add div-wrapper inside label.


Comments

Popular posts from this blog

c++ - CryptStringToBinary API behavior -

java.util.scanner - How to read and add only numbers to array from a text file -

iphone - Three second countdown in cocos2d -