r/JavaScriptHelp • • Mar 08 '22

💡 Advice 💡 Any advice?

I'm trying to get the user to be able to put there name in the string and replace Demar with it any help would help.

.<!DOCTYPE html>

<html lang="en">

<head>

	<meta charset="utf-8" />

	<title></title>

</head>

<body>	

	<script>

		Var myString = "Kevin, Kobe, Kyrie, Lamelo, Demar";

		mar myRegEXP = /Demar/;

		

		myString = myString.replace (myRegExp, "GiGi");

		alert(myString);

	</script>

	</body>
2 Upvotes

1 comment sorted by

1

u/sandybuttcheekss Mar 09 '22

Look up a Reges cheat sheet, idk who you need to do exactly but this is incorrect. You need to open the console and just play around a bit.