function SanitizeInput(input) {
input = input.replace(/</g, "<");
input = input.replace(/>/g, ">");
return input;
}
document.write(SanitizeInput("Test!<marquee>bibble</marquee>"));
If you pop this into jsfiddle.net the result is Test!<marquee>bibble</marquee without the trailing >
Can anyone explain what I'm doing wrong?
Edit: Replacing it with ( and ) seems to work perfectly