Your lecturer is, therefore, know to be incompetent at coding. In any language. As this method for for getting random integers is essentially identical in JavaScript, Java, C, C++, even BASIC of various flavors, and many other languages. SO if he/she didn't learn the right way in *SOME* language, then he/she has no business trying to teach others.
&&&&&&&&&&&&&
There are a lot of things in your code that don't make sense.
For starters, the only place you actually ever even *ATTEMPT* to change an <img> is here:
Code:
img.src = "weba.jpg";
so you are only (trying!) to affect an image for player 1 and then only when the card is a Jack.
And then, as you wrote
Quote:
|
they just come out on the page like 1-k, 1-4 and so on.
|
Well, yeah. But that's what you asked for.
You are doing
Code:
document.getElementById("sometext2").innerHTML = cardname2;
Why would you expect that to affect the appearance of some <img>? ESPECIALLY when you don't even *HAVE* any
<img> tag(s) on the page, at all!