629 posts
  • 5 Years of Membership
  • Affiliate Level 2
  • Collector Level 2
  • Exclusive Author
+4 more
VagrantRadio
says

Basically, since the “this” is inside the function that is referencing the #mydiv id, you can use “this” as a variable of the #mydiv id.

a variable is simply giving a shortened name to a defined element. say you had an text input;

<input name="foo" type="text" id="foo" />

the code below basically says variable foo equals this input value.

var foo = $("input#foo")val();

You can then access the value of the input by calling the variable.

$(document).ready(function() {
  alert("foo");
});
by
by
by
by
by
by