JSFiddle - React, Tailwind, and code Playground
JavaScript
console.log(checkQuote("abc"));
function checkQuote(str){
let res = str.match(/[\'\"]/)!==null;
if(res)
{
alert(" 不允許出現\'or \" ");
}
return res;
};
console.log(checkQuote("abc"));
function checkQuote(str){
let res = str.match(/[\'\"]/)!==null;
if(res)
{
alert(" 不允許出現\'or \" ");
}
return res;
};