Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

onclick remove textarea value

<textarea id='comments' rows='4' cols='4'></textarea>
<input type="button" value="Clear" onclick="javascript:document.getElementById('comments').value='';">
Comment

onclick remove textarea value

<input type="button" value="Clear" onclick="javascript: functionName();" >
you just need to set the onclick event, call your desired function on this onclick event.

function functionName()
{
    $("#output").val("");
}
Above function will set the value of text area to empty string.
Comment

PREVIOUS NEXT
Code Example
Javascript :: reactjs facebook login popup trigger on load page 
Javascript :: check if browser is online 
Javascript :: sleep 1 second 
Javascript :: console.log full object 
Javascript :: js double click to edit 
Javascript :: how to create an async function from a string in node js 
Javascript :: react native test redux 
Javascript :: passport google authentication node js 
Javascript :: version check 
Javascript :: javascript loading animation 
Javascript :: prompt in javascript 
Javascript :: change node bash root 
Javascript :: scroll to top vue 
Javascript :: this keyword in javascript 
Javascript :: .html jquery in javascript 
Javascript :: hide an element when window resize css 
Javascript :: javascript string to boolean 
Javascript :: The element.appendChild() Method 
Javascript :: JSON requests using API in Javascript 
Javascript :: electron open dev tools 
Javascript :: sort array ij js 
Javascript :: js get data url of pdf 
Javascript :: responsive font size react native 
Javascript :: react get current date minus 7 days 
Javascript :: access text inside a button from js 
Javascript :: switch into the postgres user windows 10 
Javascript :: add new array at the back of react state 
Javascript :: nested model in angular 
Javascript :: javascript sanitize html 
Javascript :: what is tostring in js 
ADD CONTENT
Topic
Content
Source link
Name
3+3 =