629 posts
  • Has been part of the Envato Community for over 4 years
  • Has referred 10+ members
  • Has collected 10+ items on Envato Market
  • Sells items exclusively on Envato Market
+2 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