Last active
July 20, 2018 07:51
-
-
Save dgloriaweb/74b5400237111386d6bf5db2b5bd0169 to your computer and use it in GitHub Desktop.
JS Bin// source http://jsbin.com/garamex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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