Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Javascript match() 在搜索整个字符串的情况下不起作用?
试试这个..我认为你在函数中放错了引号
<body onload="myFunction()"> </body> <script type="text/javascript"> function myFunction() { var str="entire string"; var n=str.match(str); // var n=str.match('entire string'); alert(n) } </script>