how do i get all the content inside a div? I want to save all the code that exists in the #wrapper DIV on my page. It's simple. But the fact is that ... how to select all EXCEPT for one specific object (image with the "main" class).
You can see how it works here http://www.jsfiddle.net/8A27a/
This is what I still have:
<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>
source
share