I am trying to use .append() with if statements, I have a lot of them maybe 10. What I'm trying to do is add to a div if something happens. if A is less then 5 I want to add to the div, so on and so on. .append() works good for me if I put all of the things I want to add in one .append(). But if I try to do it separately it will not work for me. I don't know what I will be adding a head of time, it depends on user data so I can't add everything I want in one .append(). My code is long so I have put a fiddle below. I know i may have other issues with this code but, just asking about .append() or a way to add to my div like i want

```
if(k3a<5) {
    msg3="need to work on q3" 
    var c = $('<p>'+msg3+'</p>')
    $('#output1').append(c);
    $output1.text(msg3);
}
if(k4a<5) {
    msg4="need to work on q4" 
    var e = $('<p>'+msg4+'</p>')
    $('#output1').append(e);
    $output1.text(msg4);
}
if(k5a<5) {
    msg5="need to work on q5" 
    var e = $('<p>'+msg5+'</p>')
    $('#output1').append(e);
    $output1.text(msg5);
}

```

I know I can do something like below, but I need to add them one by one if the condition is meet, not at once.

```
if (k1 < 10) {
    msg1 = "This will not space like a want.<br/>";
    msg2 = "I don know why not.<br/>";
    msg3 = "How come.<br/>";
    var e = $('<p>'+msg1+'</p>'+'<p>'+msg2+'</p>'+'<p>'+msg3+'</p>');
    $('#output1').append(e);
}

```

* <http://jsfiddle.net/G24aQ/21/>