Question: The problem I am trying to solve. 
I want to use jQuery to dynamically add content to a div depending on which class is being used. I am not sure why the alerts aren't working. It could be my html or the jquery itself. I want to solve this so that I can have different text appear depending on which class shows up.

Here is the HTML

```
<td>
    <div class="po size3"></div>
    <a class="external">Find your doctor</a>
    <div class="p-accessible-alt"></div>
</td>

<td>
    <div class="po size4"></div>
    <a class="external">Find your doctor</a>
    <div class="p-accessible-alt"></div>
</td>

<td>
    <div class="po size5"></div>
    <a class="external">Find your doctor</a>
    <div class="p-accessible-alt"></div>
</td>

```

Here is the jQuery

```
$(document).ready(function() {
    if ($(this).hasClass("size5")) {
        $("div.p-accessible-alt").html("<p> Blah Blah Size5</p>");
    } else if  
        ($(this).hasClass("size4")) {
        alert('TEST!!!');
        $("div.p-accessible-alt").html("<p> Blah Blah Size4</p>");
    } else if  
    ($(this).hasClass("size3")) {
        alert('TEST 3!!!');
        $("div.p-accessible-alt").html("<p> Blah Blah Size3</p>");
    }
});

```

Answer: 
You don't need the conditional at all. You should just do the following:

```
$(document).ready(function() {
    $(".size3").nextAll(".p-accessible-alt").html("Your HTML here");
    $(".size4").nextAll(".p-accessible-alt").html("Your HTML here");
    $(".size5").nextAll(".p-accessible-alt").html("Your HTML here");
});

```

<http://codepen.io/bradevans/pen/yaGyZQ?editors=1111>
The code works once you take out (this) and reference the selector .po because ,as other's have stated, (this) is actually referencing the document.

```
             <td>
                    <div class="po size3"></div>
                    <a class="external">Find your doctor</a>
                    <div class="p-accessible-alt"></div>
                </td>

                <td>
                    <div class="po size4"></div>
                    <a class="external">Find your doctor</a>
                    <div class="p-accessible-alt"></div>
                </td>

                <td>
                    <div class="po size5"></div>
                    <a class="external">Find your doctor</a>
                    <div class="p-accessible-alt"></div>
                </td>

$(document).ready(function() {
    if ($(".po").hasClass("size5")) {
        $("div.plan-accessible-alt").html("<p> Blah Blah Size5</p>");
    } else if  
        ($(".po").hasClass("size4")) {
            $("div.plan-accessible-alt").html("<p> Blah Blah Size4</p>");
    } else if  
    ($(".po").hasClass("size3")) {
             $("div.plan-accessible-alt").html("<p> Blah Blah Size3</p>");
    }       
});

```