javascript 提取全部的的方法。javascript中没有matchAll这种方法。

用while来实现类似 PHP 中的preg_match_all() :(by default7#zbphp.com)

<!DOCTYPE html>
<html>
<head>
	<title></title>
</head>
<body>

<select name="AgentIdP" ></select>
<script type="text/javascript">
var html = document.getElementById('AgentIdP').getAttribute('onchange');
var exp = /selectNull\([\'"]{1}([\w-]+)[\'"]{1}\)/ig;
var result ;
while( (result = exp.exec(html))!= null){
	console.log(result);
}
console.log(html);
</script>
</body>
</html>



相关文章:

  • 2021-07-21
  • 2022-12-23
  • 2022-02-12
  • 2022-12-23
  • 2022-12-23
  • 2022-02-13
  • 2021-08-29
猜你喜欢
  • 2021-09-01
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案