The other day I's working on a project using jQuery 3.6.0 but I found that it can't parse <template>
tags.
Refer to the below example.
const temp = $("#main");
console.log(temp.find("div").html()); // this isn't working
const temp2 = $("#main2");
console.log(temp2.find("div").html()); // this is working
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<template id="main">
<div class="first">
<span>Hola</span>
</div>
</template>
<div id="main2" style="display:none;">
<div class="first">
<span>Hola</span>
</div>
</div>
What am I doing wrong here?