Last active
February 7, 2016 21:01
-
-
Save oscarmorrison/c7bfc44099197fe702aa to your computer and use it in GitHub Desktop.
Return first Image from HTML Content
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
var getFristImage = function(content) { | |
var el = document.createElement( 'html' ); | |
el.innerHTML = content; | |
return el.getElementsByTagName( 'img' )[0].src;; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment