10 examples of 'jquery clear textarea' in JavaScript

Every line of 'jquery clear textarea' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
this disclaimer
18function clearTextArea(element) {
19 ctx = element.getContext("2d");
20 ctx.fillStyle = "black";
21 ctx.fillRect(0, 0, element.width, element.height);
22}
Important

Use secure code every time

Secure your code as it's written. Use Snyk Code to scan source code in minutes – no build needed – and fix issues immediately. Enable Snyk Code

67function hideCounter(element) {
68 var counter;
69 if ((counter = instance.getCounter(element)) && !shed.isHidden(counter, true)) {
70 shed.hide(counter, true);
71 }
72}
4function addToTextarea(textareaEl, text) {
5 if (textareaEl.selectionStart || textareaEl.selectionStart === 0) {
6 textareaEl.value =
7 textareaEl.value.substring(0, textareaEl.selectionStart) +
8 text +
9 textareaEl.value.substring(textareaEl.selectionEnd);
10 } else {
11 textareaEl.value += text;
12 }
13}
80function clearText()
81{
82 if ($('#oos_customer_email').val() == mailalerts_placeholder)
83 $('#oos_customer_email').val('');
84}
44function monitorTextarea(textarea, defaultText) {
45
46 // Set the default text
47 $(textarea).data("default", defaultText);
48 $(textarea).val($(textarea).data("default"));
49
50 // Clear the textarea when clicked on if the text in there == the default text
51 // and re-insert that default text if the user doesn't input anything
52 $(textarea)
53 .focus(function() {
54 if (this.value === $(textarea).data("default")) {
55 this.value = "";
56 }
57 })
58 .blur(function() {
59 if (this.value === "") {
60 this.value = $(textarea).data("default");
61 }
62 });
63}
52function clearInput( frm ) {
53 $( frm ).val( "" );
54}
230clear (target) {
231 this.setText('', target);
232}
73function copyToTextarea() {
74 document.getElementById('inandout').value = bespin.getContent();
75}
7function clearForm()
8{
9 $(':input').not(':button, :submit, :reset, :hidden, :checkbox, :radio').val('');
10 $(':checkbox, :radio').prop('checked', false);
11 $('#search-text').focus();
12}
33function focus(textArea: HTMLTextAreaElement): void {
34 if (!textArea) return;
35 textArea.focus();
36}

Related snippets