Last active
December 17, 2015 20:49
-
-
Save xexu/5670610 to your computer and use it in GitHub Desktop.
DOM selection jQuery-ish on IE8+
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
<html> | |
<head> | |
<title>DOM selection jQuery-ish on IE8+</title> | |
</head> | |
<body> | |
<script> | |
window.$ = function(selector) { | |
return document.querySelector(selector); | |
}; | |
(function() { | |
var item = $("body").innerHTML = "<p>hello world!</p>"; | |
console.log(item); | |
}()); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment