I'm trying to convert a character type <and >in <and >etc.
User input is taken from the text field and then copied to the DIV under the name changer.
here is my code:
function updateChanger() {
var message = document.getElementById('like').value;
message = convertHTML(message);
document.getElementById('changer').innerHTML = message;
}
function convertHTML(input)
{
input = input.replace('<', '<');
input = input.replace('>', '>');
return input;
}
But he does not replace >, only <. Also tried like this:
input = input.replace('<', '<').replace('>', '>');
But I get the same result.
Can someone point out what I'm doing wrong here? Greetings.
source
share