Easy way to clear the contents of the input

1. first to write a method

// Set removal method
function clearn (E) {
$ (E) .val ( "");
}

2. input the name of the corresponding write (I pasted my code directly may be a bit messy, but the corresponding thing to note, id name and to pass something);

<input type = "" style = "outline: none; // removing selected frame
background-color: rgba (0, 0, 0, 0); // transparent background; width: 100%; height: 72%; border : 0; "ID =" names "/>
</ div>

<span id="clearn" style="font-size: 0.5px;" onclick="clearn('#names')">X</span>

Guess you like

Origin www.cnblogs.com/cai-bai/p/11772397.html