Q:

How to filter raw element value javascript?

I want to textarea raw value like 123abc!@ to filter 123and abc and !@# and show in number ,symbol and string id.

function getValue() {
  var all = document.getElementById( 'allText' ).value;

  all.filter = number; 
  all.filter = string;
  all.filter = symbol;   
  document.getElementById( 'number' ).innerText = all;
  document.getElementById( 'symbol' ).innerText = all;
  document.getElementById( 'string' ).innerText = all
}
<label>Number:</label><p id="number"></p>
<label>Symbol:</label><p id="symbol"></p>
<label>String:</label><p id="string"></p>
<label>Write any:</label><textarea onkeydown="getValue()" id="allText"></textarea>

A:

You can use regular expressions on all to match a subset of characters within its value. Note that all is a string itself, and so are all characters within it by themselves. I've also changed the event to listen to from keydown to input. Here's a working example:

function getValue() {
  var all = document.getElementById( 'allText' ).value;

  document.getElementById('string').innerText = (all.match(/[a-z]/gi)  || []).join('');
  document.getElementById('number').innerText = (all.match(/\d/g)      || []).join('');
  document.getElementById('symbol').innerText = (all.match(/[^\s\w]/g) || []).join(''); 
}
body { display: flex; }
label { font-weight: bold; }
* { text-align: left; margin: 0.5rem; }
<div class=input>
  <label>Write any:</label><textarea oninput="getValue()" id="allText"></textarea>
</div>

<table class=output>
  <tr><th>Numeric:</th><td id="number"></td></tr>
  <tr><th>Symbol:</th><td id="symbol"></td></tr>
  <tr><th>Alpha:</th><td id="string"></td></tr>
</table>

... .join('')
the String.match(...) function returns an array with all matches if some were found. For example, "abc".match(/[a-z]/g) would return ["a", "b", "c"]. Hence the calls to ... .join('') at the end. This concatenates all characters in the array to one single string.
all.match(...) || []
If String.match did not find any matches, null is returned instead. In order to be able to call .join unconditionally, null values default to an empty array with this syntax.

