My div is closing itself.
<html><head><title></title>
<script type="text/javascript" charset="utf-8" src="jquery-1.7.min.js"></script>
<script>
$(document).ready(function(){
$("#wrapper").append( '<div id="content"><br>test');
$("#wrapper").append('<br>whatever');
$("#wrapper").append( 'sfga<br></div>' );
});
</script>
</head><body>
<div id="wrapper">
</div>
</body></html>
The div is automatically closing after test is output and not after sfga like it should.
How to fix this?
Dirty fix:
Proper way of doing it:
Why this happens? Because jQuery is automatically creating proper DOM elements when given raw HTML, while letting you append to them with the above chaining.