Sorry for the incredibly lame question, but as a completely new programmer, all the answers that I found during the search all day concern other issues that are not related to me, so I decided that I would post about it.
I made a commitment to convert the sample “Random Quote Generator” that I found in a small web application that can create random links with the click of a button, but since I soon found that I was just replacing the examples with links of my choice, I created just plain text without a click.
I have tried many things related to mess with div and id tags but nothing works for me.
My code for html is as follows:
<html>
<head>
<title>Simpsons Episode Generator</title>
</head>
<body>
<h1>Simpsons Episode Generator</h1><br>
<img src="https://vignette2.wikia.nocookie.net/simpsons/images/9/97/Mr_Burns_-_the_box.jpg/revision/latest?cb=20121215235014" alt="Mr Burns box">
<div id="linkDisplay">
</div>
<button onclick="newLink()">New Episode</button>
<script src="javascript.js"></script>
</body>
</html>
, , javascript , .
javascript :
var links = [
'http://kisscartoon.so/episodes/the-simpsons-season-1-episode-1/',
'http://kisscartoon.so/episodes/the-simpsons-season-1-episode-2/',
'http://kisscartoon.so/episodes/the-simpsons-season-1-episode-3/',
'http://kisscartoon.so/episodes/the-simpsons-season-1-episode-4/',
'http://kisscartoon.so/episodes/the-simpsons-season-1-episode-5/',
'http://kisscartoon.so/episodes/the-simpsons-season-1-episode-6/'
];
function newLink() {
var randomLink = Math.floor(Math.random() * (links.length));
document.getElementById('linkDisplay').innerHTML = links[randomLink];
}
, , , HTML , .
, , ...