Created
January 10, 2015 18:46
-
-
Save lilrogalski/67adea078940fa49bd4d to your computer and use it in GitHub Desktop.
This file contains 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
$.fn.extend renameAttr: (name, newName, removeData) -> | |
val = undefined | |
@each -> | |
val = $.attr(this, name) | |
$.attr this, newName, val | |
$.removeAttr this, name | |
# remove original data | |
if removeData isnt false | |
$.removeData this, name.replace("data-", "") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment