How do I insert an image instead of using text in Javascript? -


I want to use hyperlink to show an image instead of using text in the starred text below, but I'm sure Do not let that happen. Is it possible to do this within javascript ?? I have tried to see other questions of similar parameters, but I am not sure how to translate replies to my questions. Thanks!

  var user; Choose Var = function (like) {user = option; } Var computerChoice = Math.random (); If (Computer Choice <0.34) {computerChoice = "rock"; } And if (Computer Choice <0.67) {computerChoice = "paper"; } And {computerChoice = "scissors"; } Var Comparison = Function (like 1, Preferred 2) {if (choice1 === choice2) {document.getElementById ("Results"). InnerHTML = "tie!"; } And if (like 1 === "rock") {if (like 2 === "scissors") {document.getElementById ("Result"). InnerHTML = "You Win!"; } And {document.getElementById ("Result"). InnerHTML = "You Lost!"; }} And if (like 1 === "paper") {if (choice2 === "rock") {document.getElementById ("result"). InnerHTML = "You Win!"; } And if (like 2 === "scissors") {document.getElementById ("Result"). InnerHTML = "You Lost!"; }} And if (like 1 === "scissors") {if (choice2 === "rock") {document.getElementById ("Result"). InnerHTML = "You Lost!"; } And if (like 2 === "paper") {document.getElementById ("Result"). InnerHTML = "You Win!"; }} And {document.getElementById ("Result"). InnerHTML = "Error!"; }}  

Yo needs to be entered:

  Document.getElementById ("Results"). InnerHTML = "& lt; img src = 'yourimg' alt = 'yourimgtext' / & gt;  

Where "yourimg" is the image that you want to show.


Comments

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -