Everyone_Else Everyone_Else - 3 months ago 13
Javascript Question

Console.log not working javascript/jquery

I am trying to get started with javascript, but I can't see to get console.log to work.

In the

head
, I load jquery as follows:

<script type="text/javascript" src="http://code.jquery.com/jquery.min.js"></script>


Then, right before the end of
body
, I place the document.ready function as follows:

$( document ).ready(function() {
console.log( "ready!" );
});


No other javascript/jquery is present in the file. I expected the phrase "ready!" to be logged to the console, but instead, nothing happened. How can I fix this?

Answer

you need to wrap your code in a <script> tag