However, when I reload the page, the alert that gets triggered comes back saying "undefined" I've checked all the syntax out and it looks like everything is all good. Anyone see where the problem is? This is running on my localhost, but I do have JQuery called in my HTML, so it should work. I'm also pretty new at this stuff, so any help would be appreciated. Thanks, Noel
You should pretty much always use $(document).ready though, as it ensures that the DOM is completely loaded before you start manipulating it with javascript.
CSS:
and Javascript:
However, when I reload the page, the alert that gets triggered comes back saying "undefined" I've checked all the syntax out and it looks like everything is all good. Anyone see where the problem is? This is running on my localhost, but I do have JQuery called in my HTML, so it should work. I'm also pretty new at this stuff, so any help would be appreciated.
Thanks,
Noel
no dot in the selector
and this is the RIGHT way:
if you do do it the first way, by loading the scripts in the head, you need to call
in your script file.