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
(function(word) { | |
var walk=document.createTreeWalker(document.body,NodeFilter.SHOW_TEXT,null,false), el; | |
word=word.split(""); | |
while(el=walk.nextNode()) { | |
el.nodeValue = el.nodeValue.replace(/\w+/g, function (o) { | |
return word.map(function (v, i) { | |
return (o[i] < "a") ? v.toUpperCase() : v; | |
}).join(""); | |
}); | |
} | |
})("hodor"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
yeah but dat formatting doe
also you're re upper casing it for every letter