Question: I have the following input fields and I would like to have a link above them that uses pure javascript *(ie: no js libraries)* that would remove the commas from all of the input fields.

**Current:**

```
<span id="remove">click to remove commas</span>    
<input type="text" name="1" id="1" value="14,22,25,2,26,1,15,8,23"><br />
<input type="text" name="2" id="2" value="12,25,14,11,5,23,8,15,19"><br />
<input type="text" name="3" id="3" value="25,1,10,2,26,5,19,7,13,22"><br />
<input type="text" name="4" id="4" value="8,1,16,20,19,7,25,2,14,27"><br />
<input type="text" name="5" id="5" value="8,15,6,22,30,21,4,24,31,3">

```

**Wanted Results:**

```
<span id="remove">click to remove commas</span>
<input type="text" name="1" id="1" value="142225226115823"><br />
<input type="text" name="2" id="2" value="1225141152381519"><br />
<input type="text" name="3" id="3" value="2511022651971322"><br />
<input type="text" name="4" id="4" value="8116201972521427"><br />
<input type="text" name="5" id="5" value="8156223021424313">

```

Answer: 
[Fiddle](http://jsfiddle.net/fzasvbyb/)

JavaScript:

```
var removeSpan = document.querySelector('#remove');

removeSpan.addEventListener('click', function(e){
    [].slice.call(document.querySelectorAll('[type="text"]')).forEach(function(text){
        text.value = text.value.replace(/,/g, '')
    });
});

```
You can use [.replace](http://www.w3schools.com/jsref/jsref_replace.asp), like this:

```
var res = str.replace(",", ""); 

```