Answer the question
In order to leave comments, you need to log in
jQuery not seeing element?
There is an HTML template:
<script id="template" type="text/html">
<input type="text" class="lol">
</div>
var template = $('#template')
console.log(template.html()) // Все нормально, шаблон находит
console.log(template.find('[type="text"]').attr('class')); // Уже все, undefinded
Answer the question
In order to leave comments, you need to log in
Invalid HTML. The script tag opens and the div closes. This is how it will work:
<div id="template">
<input type="text" class="lol">
</div>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question