+ 2
How can one define $ in jQuery?
I still don't understand why some my jquery code are not working and yet others are working. I used the same criteria but parts of the code is responding and the errors and warnings indicates that $ is used before it's defined. need help on this.
1 Answer
+ 2
Most likely the Javascript is loading before your jquery script.
wrap it in onload event like below
window.onload = function(){
//my jquery code
$('#txt').html = 'some text'
} // onload end