how do I get all content inside a DIV? I want to save all the code that exists within #wrapper DIV on my page. That is easy. But the thing is... how do I select all EXCEPT for one particular object (the image with "main" class).
You can see how it works here <a href="http://www.jsfiddle.net/8A27a/" rel="nofollow">http://www.jsfiddle.net/8A27a/</a>
This is what I have so far:
You can see how it works here <a href="http://www.jsfiddle.net/8A27a/" rel="nofollow">http://www.jsfiddle.net/8A27a/</a>
This is what I have so far:
Code:
<div id="wrapper">
<div class="icon"><img src="http://www.yousendit.com/en_US/theme_default/images/g_logo_trans_110x63.gif"></div>
<div class="icon"><img src="http://www.yousendit.com/en_US/theme_default/images/g_logo_trans_110x63.gif"></div>
<div class="icon"><img src="http://www.yousendit.com/en_US/theme_default/images/g_logo_trans_110x63.gif"></div>
<img class="main" src="http://afteramerica.files.wordpress.com/2010/01/061221225103_abraham_lincoln_lg1.jpg">
</div>
<input type="button" value="save" class="save">
<script>
$(document).ready(function() {
$('.save').live('click', function() {
var content = $('#wrapper').html();
alert(content);
});
});
</script>