I was doing some reading on jQuery and found out something hidden in plain sight (well hidden from me!). You can narrow your selector search by passing in a jQuery object as a second parameter. This is known as setting the context.
var nav = $('#nav');
var liItem = $('li', nav);
If you are preparing and/or binding parameters, check and make sure that you didn’t put quotes around your parameters. Had a frustrating “bug” turn out to be that the PDO prepare method automatically adds quotes around the parameters. So I was effectively building a query like this ” “1” ” instead of “1”.
Just a quick tip/note. I was using the jQuery validation plugin recently and was perplexed as to why it wasn’t validating a field I had set as ‘required’. After a a few minutes I realized it was due to some invalid HTML. I had not set the type of the input and it appears that the plugin matches inputs on type (otherwise it might try and validate things you didn’t expect I imagine. Anyway, if you ever run across an instance where it isn’t validating a field that you explicitly tell it to, check the HTML and make sure the type attribute is set.
<input type="text" name="firstName" class="text-input" />
<input name="firstName" />