jquery prepend html

Add an html table before a paragraph. This example prepends a table to the paragraph with id 'textAppend'.

Some intro text...

Code

<p id="textAppend">Some intro text...</p>

<button type="button" onclick="appendText()" >Go!</button>
<script>
function appendText()
{
$( "#textAppend" ).prepend( "<table border='1'><tr><th>Heading 1</th><th>Heading 2</th></tr><tr><td>Col 1</td><td>Col 2</td></tr></table>" );
}
</script>