Trouble setting the HTML of a variable in JQuery
<p>What I've done is loaded some HTML from a file and I am attempting to modify some elements within that HTML.</p>

<p>The initialization looks like this:</p>

<pre><code>var id = player_info["ID"];
$("#main_container").append(
    $("&lt;div /&gt;").attr({class: "player_container", id: "player_" + id}).css("display", "none")
);

// Add all information to the player container
var player_container = $("#player_" + id);
player_container.load("player_layout.html");
</code></pre>

<p>With <code>player_layout.html</code> looking like this:</p>

<pre><code>&lt;div class="player_name"&gt;

&lt;/div&gt;
&lt;div class="player_chips"&gt;
    Chips:
    &lt;br/&gt;
    &lt;span class='bidding'&gt;&lt;/span&gt;/&lt;span class='chips'&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;div class="player_stats"&gt;
    Wins / Losses
    &lt;br/&gt;
    &lt;span class="wins"&gt;&lt;/span&gt;/&lt;span class="losses"&gt;&lt;/span&gt;(&lt;span class="total_games"&gt;&lt;/span&gt;)
    &lt;br/&gt;&lt;br/&gt;
    Chips Won / Chips Lost
    &lt;br/&gt;
    &lt;span class="chips_won"&gt;&lt;/span&gt;/&lt;span class="chips_lost"&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;button class="player_won"&gt;Player Has Won&lt;/button&gt;
</code></pre>

<p>I then want to modify some of the elements, specifically classes. An example of the way I was initially doing this is:</p>

<pre><code>player_container.find(".player_name").text(player_info['username']);
</code></pre>

<p>This wasn't working so I then tried to switch <code>find</code> with <code>children</code> and <code>text</code> with <code>html</code> but that didn't seem to work. I then tried this:</p>

<pre><code>$('&gt; .player_name', player_container).html(player_info['username']);
</code></pre>

<p>but that also didn't work. I understand that I can use DOM to grab the <code>childNodes</code> and compare the class names but there are a lot of classes that need modifying and I'd also like to know if this is possible in JQuery. Thanks in advance for any help.</p>