0

I've been using JQuery recently and all was going well…and then this came up and I'm very confused by it. I created a new page for testing purposes, and am getting the same error no matter what I try…

The HTML code is:

<div id="a" ></div>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.2/jquery.min.js"></script> 
<script>
   $(document).ready(function() {
       $('#a').hmtl("<div>test</div>");
   });  
</script> 

And the error is: TypeError: 'undefined' is not a function (evaluating '$('#a').hmtl("<div>test</div>")'). Most of the answers I found here said to load JQuery before the script, which I am doing, to no avail.

Thanks...

3 Answers 3

3

change

$('#a').hmtl("<div>test</div>");

to

$('#a').html("<div>test</div>");
Sign up to request clarification or add additional context in comments.

1 Comment

oh gosh…that is embarrassing. Thank you!
3

You have a spelling mistake: $('#a').hmtl("<div>test</div>");. It should be html not hmtl.

2 Comments

Oh dear…that is embarrassing. Thank you!
(Accepted srinath's answer just because that one was first…sorry)
0

the function is undefined because it's not hmtl but html

thanks

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.