My code is like this:
<script>
var name = document.getElementById("nusname").innerHTML;
document.getElementById("uName").innerHTML = "Welcome, " + name;
$('#uName').text("AsgufHFBS");
</script>
The 3rd line
document.getElementById("uName").innerHTML = "Welcome, " + name;
works but the 4th line
$('#uName').text("AsgufHFBS");
does not.
I have tried replacing this with
$(document).ready(function(){
$('#uName').text("AsgufHFBS");
});
but it still does not work.
So my question is this: Why does the javascript work but the not the JQuery version?