I'm trying to append and prepend html block inside text-area using button click, but it's not working on Internet Explorer.
$(document).ready(function () {
"use strict";
$('#export-file').click(function () {
document.getElementById("codeToSave").prepend('<!doctype html>\n<html> \n<head>');
document.getElementById("codeToSave").append($.trim('</body>\n</html>'));
});
});
<ul class="control-list">
<li class="controls" id="export-file" data-toggle="tooltip" title="Export " ><i class="fas fa-download"></i></li>
</ul>
<textarea id="codeToSave" disabled class="scrollStyle-3" ></textarea>
Aucun commentaire:
Enregistrer un commentaire