Javacsript text string converter

At work I had these strings that looked something like this:


And I would need to remove the curly brackets and the hyphens and then paste the result into the HTML I was working with. This was, of course, obnoxious and super prone to human error. So I went ‘a searching and found resources (listed after the code) that gave me enough information that I was able to put together the following:

<!DOCTYPE html>
      Enter your text then click the button below.
    <input type="text"
    <button type="button" 
    <p id="demo"></p>
        // Here the value is stored in new variable x 
        function imageIDConvert() {
            var stringInput = 
			var stringOutput = stringInput.replace(/-/g,"").replace(/{/g,"").replace(/}/g,"");
              "demo").innerHTML = stringOutput;


I’ve never touched Javascript before, so I’m feeling fairly pleased with myself!

This makes things so much faster, ahhhh.