Replace Div with content
<p>I'm new to javascript/jquery and there is something fundamental that I am overlooking. I want to replace the content of a div with some text by calling a function. Absolutely every thing I have tried has failed. </p>

<p><a href="http://jsfiddle.net/spuder/dTGBy/" rel="nofollow">http://jsfiddle.net/spuder/dTGBy/</a></p>

<p>html </p>

<pre><code>&lt;body&gt;
&lt;div id=test&gt;

&lt;/div&gt;
&lt;/body&gt;
</code></pre>

<p>script</p>

<pre><code>$(document).ready( function()  {

   getTest();

}



function getTest() {
    $("#test").html("Hello World");
    //$('#test').replaceWith('&lt;h2&gt;New heading&lt;/h2&gt;');
    //$("#test").attr("text","http://www.w3schools.com/jquery");
    //$("#test").attr("href","http://www.w3schools.com/jquery");
    //$("#test").html("New text");
    //$(".test").html("New text");
    //$("test")html.("New text");
    //$("test").update("New text");
    //document.getElementById("testSpan").innerHTML = "42";
    // $("#test").html("&lt;b&gt;Hello world!&lt;/b&gt;"); 
}

//This is supposed to be super easy ^

//http://www.w3schools.com/jquery/tryit.asp?filename=tryjquery_dom_html_set
//http://www.w3schools.com/jquery/tryit.asp?filename=tryjquery_dom_attr_set
//http://www.willmaster.com/library/web-development/replace-div-content.php
//http://api.jquery.com/replaceWith/
</code></pre>
