jquery - How to display image in place of checkbox? -


i want display green checked image when checkbox checked , when not checked empty box. tried put checkbox in div , set div's background not helping me out. idea do? below output want.

image

like little jquery , css: demo

<div class="checkbox"> </div>  .checkbox{    width: 23px;    height: 21px;    background: transparent url(http://i.stack.imgur.com/s4p2r.png ) no-repeat 0 50% } .checked{    background: transparent url(http://i.stack.imgur.com/s4p2r.png ) no-repeat 80% 50% }  $(".checkbox").click(function(){     $(this).toggleclass('checked') }); 

Comments

Popular posts from this blog

php - Why I am getting the Error "Commands out of sync; you can't run this command now" -

linux - Does gcc have any options to add version info in ELF binary file? -

java - Are there any classes that implement javax.persistence.Parameter<T>? -