Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var div = $("div"), p = $("<p />").appendTo(div);
- div.data("p", p).click(handler);
- function handler(event) {
- // much faster
- $(this).data("p").css("margin-top", 100);
- // than this
- $(this).children("p").css("margin-top", 100);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement