I am new to Jquery and javascript.
While I was writing a javascript code, I found myself using a particular jquery object often, so I declared a variable for it. For example,
$(document).ready(function() { var object_list = $("#object_list"); /*Do something with the variable*/ alert(object_list); object_list.hide(); }); However, this doesn't seem to work ("alert(object_list)" gives me a null value).
Is declaring a variable like this wrong in jquery???
If so, then what is the right way so that I can refer to commonly used Jquery object??\
Thanks!
nullvalue? Did you somehow overwrite$, for example by loading Prototype.js?$()here is not an alias tojQuery().Array, empty or containing one or more HtmlElement objects.