I am trying to make something, where, if you input your minecraft username, you get your profile icon.
I found this website Minotar, where you could get icons by the url. So, I tried making a JavaScript script out of it, and display it. But, the picture doesn't want to show up when I click "Go!".
What have I done wrong?
Here is my code.
<script>function usernameget(){ var username = document.getElementById("username").value; var url = "http://www.minotar.net/avatar/"+ username +"/150"; document.getElementById("usernamepicture").setAttribute("src", url);}</script><form><img id="usernamepicture" src=""><p>Your Minecraft Username</p><input type="text" id="username"><button onclick="usernameget()">Go!</button></form>