I am trying to replace # and space from a string if it has these two characters.
This is for markdown previewer.
var t = document.getElementById("textbox");
var h1 = (t.value === "/#\s/") ? t.value.replace(/^[#\s]/, "") : t.value;
console.log(h1);
How do I solve this problem?
t.value === "/#\s/"is true when t.value is literally and exactly/#s/only