Имеется вся страница, начиная от <!DOCTYPE html>, заканчивая </html>.
Как мне эту строку распарсить в объект jQuery что бы у меня получился html?
Сейчас же я получаю набор из всех элементов которые есть в body, а мне нужно все, включая head и body.
Еще проблема с парсингом в экранировании символов, таких как ".
Интересующая Вас информация содержится в document.documentElement
console.log(document.documentElement)
Используйте $($.parseHTML('Ваша строка-страница'));
var dom_nodes = $($.parseHTML('<!DOCTYPE html><html lang="en-US"><head><title>HTML Examples</title><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="Keywords" content="HTML,CSS,JavaScript,SQL,PHP,jQuery,XML,DOM,Bootstrap,Web development,W3C,tutorials,programming,training,learning,quiz,primer,lessons,references,examples,source code,colors,demos,tips"><meta name="Description" content="Well organized and easy to understand Web building tutorials with lots of examples of how to use HTML, CSS, JavaScript, SQL, PHP, and XML."><link rel="icon" href="/favicon.ico" type="image/x-icon"><link rel="stylesheet" href="/w3css/4/w3.css"><style>a:hover,a:active{color:#4CAF50}</style></header><body><h1>My First Heading</h1><p>My first paragraph.</p><div><input type="text" value="тестовое значение" /></div></body></html>'));
console.log(dom_nodes);
alert( dom_nodes.find('input').val() );
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
Сборка персонального компьютера от Artline: умный выбор для современных пользователей