I am trying to find all the numeric values in a textbox text and highlight them but nothing is happening. The code is below. Can you please help identify what is that I am doing wrong?
model Notes.Models.NotesModel
<html>
<head>
<title>Notes</title>
<style>
.highlight {background-color :yellow;}
</style>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.2/jquery.min.js"></script>
<script type="text/javascript" language="javascript">
function PIIHighlight() {
var regex = new RegExp("D+", "gi");
alert(document.getElementById("Notes").value.toString());
retu $("Notes").each(function () { document.getElementById("Notes").value.replace(regex,function (matched) { retu "<span class="" + highlight + "">" + matched + "</span>"; });
});
};
</script>
</head>
<body>
<p> <input id="Notes" name="notes" type="text" spellcheck="true" class="txtbox" style="font-size:12pt;height:220px;width:600px;" /></p>
<p> <button onclick="PIIHighlight();">Check</button></p>
</body>
</html>
Thank you!
