I am trying to access the contents of the html of a script block with the type set to "text / template". I heard about the mechanisms of templates using such tags, but my application is very simple and loading the entire engine is not needed. Can someone shed some light on how I select this item? I think the jQuery.html () function will get the content for me, but I cannot find the element.
The template looks like this:
<script type="text/template" id="repeating-form-section-template">
<div class="repeating-form-section">
<label>Field Name:</field>
<input type="text" value="default value" name="field_name" />
</div>
</script>
Things I tried:
getElementById('repeating-form-section-template');
$('script').filter(...);
$('#repeating-form-section-template');
$("script[type='text/template']");
Thank!
source
share