Created
July 7, 2013 03:17
-
-
Save aliencode/5942138 to your computer and use it in GitHub Desktop.
jQuery查找附近某个元素
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
| $('.postTitle').each(function(p){ | |
| //向后*nextAll*或向前*prevAll* | |
| $(this).attr('data-date', $(this).nextAll('.postDesc').eq(0).text() ) | |
| }) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment