mardi 11 août 2015

JQuery: select p inside a input checkbox type

i want to change my p tag style

my html code: <input type="checkbox"><p> paragraph</p>

jquery:

$('ul.list').on("click", "input", function(){

                if( $(this).is(':checked') ) {
                    $(this).find('p').css("text-decoration" ,  "line-through");
                } else {
                    $(this).find('p').css("text-decoration", "none");
                }
            });



Aucun commentaire:

Enregistrer un commentaire