How to use .html() in jquery to get all of the html including the container????

Hi, I am trying to get the entire html for my icon class:

          
<div class="icon">
        	<a href="necklaces/purse_copper_hw.jpg">
                <img src="necklaces/copper_icon.png" />	
        	</a>
        	<a href="necklaces/purse_copper_hw2.jpg"></a>          
        	<a href="necklaces/purse_copper_hw3.jpg"></a>          
            <input type="button" class="fav" value="Favorite" />
            <span class="faved hide">FAVORITED</span>
        </div>

Open in new window


but when I do something like this

$(".icon").html()

Open in new window


It gives me whats inside of the .icon div, but I want it to include the container div (.icon). Anyone know how to this??
FairyBusinessAsked:
Who is Participating?
 
darren-w-Commented:
     <div class="icon">
        	<a href="necklaces/purse_copper_hw.jpg">
                <img src="necklaces/copper_icon.png" />	
        	</a>
        	<a href="necklaces/purse_copper_hw2.jpg"></a>          
        	<a href="necklaces/purse_copper_hw3.jpg"></a>          
            <input type="button" class="fav" value="Favorite" />
            <span class="faved hide">FAVORITED</span>
        </div>
        <div id="place"></div>

Open in new window


$("#place").html($(".icon")[0])

Open in new window


this will capture the content of the first returned element and place it in the div id=place
0
 
FairyBusinessAuthor Commented:
thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.