[Vuejs]-Laravel 5: Clear the ckeditor using javascript

0👍

You can do something like that just a simple function to clear your textarea and in case of you’re using vuejs instead of document.querySelector and document.getElementById use

vuejs – refs

calling this function after your submission works too.

const textarea = document.querySelector("#description");

document.getElementById("#btn").addEventListener("click", function() {
  textarea.innerHTML = "";
})
<textarea class="form-control" name="description" id="description">hello</textarea>
<button id="#btn">clear</button>

Leave a comment