Javascript examples for RegExp:RegExp test
Test a variable with a regExp, and show returned value
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> </head> <body> <script> function changeCode(){/*from ww w . j a v a2 s . c o m*/ var field = document.getElementById("fld"); console.log(field.value.match(/\d+px/g)); } </script> <textarea id="fld"></textarea> <button id="btn" onclick="changeCode();">Get</button> </body> </html>