Last active
October 12, 2015 18:29
-
-
Save sarfraznawaz2005/8995ddebe379b81c0bfe to your computer and use it in GitHub Desktop.
Making Cross Browser Functions
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
var getMyText = function(myDiv) { | |
getMyText = | |
myDiv.innerText !== undefined ? // innerText not supported in FF | |
function(myDiv) {return myDiv.innerText} : | |
function(myDiv) {return myDiv.textContent}; | |
return getMyText(myDiv); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment