629 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 4-5 years
  • Referred between 10 and 49 users
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • United States
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