My code is only half working - it is bringing over font-size and font-family but nothing else :(. Here is the CSS:
#block2 {
background-color: #99F5F5;
border: solid;
border-color: #7AC4C4;
font-size: 30px;
font-family: sans-serif;
width: 355px;
height: 40px;
}
Here is my jquery:
$(document).ready(function() {
$('#btn1').click(function() {
$("ul").addClass("#block2").append("<li>" + $("#txt1").val() + "</li>");
$("#txt1").val("").focus();
});
});
Like I said above - when I click btn1 I append a new 'li' but the CSS is only bringing over the font-size and font-width. Please help!! I'd like for all of #block2 to work when I append a new 'li'.
$("#txt1").val("").focus();- this is wrong, should be$("#txt1").focus();#block2is incorrect classname..when your css is an ID#