I need to get the value of the textarea but I cannot get the value using the WYSIWYG text editor. I got the value without WYSIWYG text editor but I need the value in WYSIWYG text area. How can I fix this?
<!--Jquery CDN-->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<!--WYSIWYG Texteditor CDN-->
<script src="https://cdn.tiny.cloud/1/142v261jlrz3ntk7kklzqfs5hzmv2lhvw3ln73zsq66ln2pr/tinymce/5/tinymce.min.js" referrerpolicy="origin"></script>
<form th:action="@{/answerSave}" method="post"th:object="${answer}">
<textarea id="comment" name="comment" th:field="*{fullAnswer}"> </textarea><br>
<button id="previewAnswers" class="btn btn-success" onclick="answerQuestionMappping()">Submit Answer</button>
</form>
This is my javascript part
function answerQuestionMappping(){
var answerComment = $("#comment").val();
console.log(answerComment);
alert(answerComment);
}