javascript - using 2 classes from css and jquery together -
i'm trying apply css class , jquery class checkbox
<input type='checkbox' name='something' class='group_ctrl' data-group='group_a' id='checker'>
css code class = 'styled' (jquery code combined css code style checkbox)
.checkbox, .radio { width: 19px; height: 25px; padding: 0 5px 0 0; background: url(images/checkbox.png) no-repeat; display: block; clear: left; /* float: left; */ }
jquery code class = "group_ctrl"
$(document).ready(function() { $('.group_ctrl').change(function () { // gets data-group value , uses in outer selector // select inputs controls , sets disabled // property negated value of it's checked property $("." + $(this).data("group")).prop('disabled', !this.checked); }).change(); });
the current html allows checkmark enable or disable other fields in can see in jquery, css code allows me style the checkbox. 2 not go together. i've tried class"group_ctrl styled" already. doesn't work. suggestions without altering code on massive scale?
the css have included applies class of checkbox or radio.
.checkbox, .radio { width: 19px; height: 25px; padding: 0 5px 0 0; background: url(images/checkbox.png) no-repeat; display: block; clear: left; /* float: left; */ }
if correct css should applying either checkbox or radio class fields not styled.
edit
if .checkbox, .radio in css apply checkboxes , radios, need remove . i.e. checkbox, radio, not .checkbox, .radio
correction - pointed out me.. checkbox , radio not valid tags, input
Comments
Post a Comment