Próbuję utworzyć div i dać mu klasę, ale to nie działa. Czy ktoś może mi pomóc?Jak utworzyć div z klasą
$(document).ready(function() {
$('input[type=checkbox]').each(function() {
$(this).after($('<div />', {
className: 'test',
text: "a div",
click: function(e){
e.preventDefault();
alert("test")
}}));
});
});
css:
.test {
width:200px;
height:200px;
background-color:#eeeeee;
}
w tej chwili tworzy div ale kolor nie jest #eeeeee
Proszę podać kod HTML zbyt ... – Luke