JSFiddle - React, Tailwind, and code Playground
HTML
<input type="text" id="textbox" />
<input type="button" id="btn" onclick="roll()" value="Roll" /><br/>
<img id="img1" />
JavaScript
function roll(){
var textBox = document.getElementById("textbox");
var textBoxValue = textBox.value;
var die = document.getElementById("img1");
die.src = "http://fetlar.kingston.ac.uk/pp/dice" + textBoxValue + ".png";
}