Created
December 23, 2010 14:30
-
-
Save johnantoni/753047 to your computer and use it in GitHub Desktop.
jquery - determine element clicked on, if outside the post textbox clear the value
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // jquery get mouse location | |
| // clear post when lose focus | |
| $("*", document.body).click(function (e) { | |
| e.stopPropagation(); | |
| var domEl = $(this).get(0); | |
| if (!$(domEl).closest("#newsfeed_post").length > 0) { | |
| $("#newsfeed_post textarea").css("color", "#aaa").val("Write something here..."); | |
| } | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment