The code copy is as follows:
var str = "National [1990] No. 12";
How to prefix "[" and "]" in variables with backslashes,
It is to be replaced with this: str = "National name/[1990/] No. 12";
The code copy is as follows:
<script language="javascript" type="text/javascript">
var str = "National [1990] No. 12";
str=str.replace(//[/g,'//[');
str=str.replace(//]/g,'//]');
document.write(str);
</script>