Created
November 2, 2011 16:01
-
-
Save jnwheeler44/1334019 to your computer and use it in GitHub Desktop.
Convert text to a dom element in jQuery
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
// Had an interesting problem today by trying to load a textarea's contents as dom elements. | |
// Here's what I did: | |
// get my value and convert into a dom element | |
var string = $('#article_body').val(); | |
var element = $("<div>" + string + "</div>"); | |
// from there, I can get what I need | |
element.find("video").attr('src'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment