Skip to content

Instantly share code, notes, and snippets.

@dgloriaweb
Last active July 20, 2018 07:51
Show Gist options
  • Save dgloriaweb/74b5400237111386d6bf5db2b5bd0169 to your computer and use it in GitHub Desktop.
Save dgloriaweb/74b5400237111386d6bf5db2b5bd0169 to your computer and use it in GitHub Desktop.
JS Bin// source http://jsbin.com/garamex
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<input type="text" id="txt" />
<br/>
<input type="button" id="btn" onclick="processString()" value ="process string"/>
<br/>
<textarea id="textarea" rows="4" columns="30"></textarea>
<script id="jsbin-javascript">
function processString (){
document.getElementById('textarea').value="";
var string = document.getElementById('txt').value;
var result= string.match(/\d+/g);
if (result!=null)
{
for(var i=0; i<result.length;i++)
{
document.getElementById('textarea').value+=result[i]+"\r\n";
}
}
}
</script>
<script id="jsbin-source-javascript" type="text/javascript">function processString (){
document.getElementById('textarea').value="";
var string = document.getElementById('txt').value;
var result= string.match(/\d+/g);
if (result!=null)
{
for(var i=0; i<result.length;i++)
{
document.getElementById('textarea').value+=result[i]+"\r\n";
}
}
}</script></body>
</html>
function processString (){
document.getElementById('textarea').value="";
var string = document.getElementById('txt').value;
var result= string.match(/\d+/g);
if (result!=null)
{
for(var i=0; i<result.length;i++)
{
document.getElementById('textarea').value+=result[i]+"\r\n";
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment