I am having difficulty with a slider containing URL links inside an Array. Can anyone help me figure out how to make this code run properly? Here is the link to the code: https://codepen.io/konradszymanski/pen/VwvLgYG?editors=0110
Below is the HTML:
<script src='https://kit.fontawesome.com/a076d05399.js'></script>
<div class="container">
<button class="left" onclick="" ><i class='fas fa-angle-left'></i></button>
<button class="right" onclick="next()"><i class='fas fa-angle-right'></i></button>
</div>
And here is the JavaScript code:
var images = [
{ img: "https://upload.wikimedia.org/wikipedia/commons/5/50/Bodiam-castle-10My8-1197.jpg" },
{ img: "https:upload.wikimedia.org/wikipedia/commons/4/4d/Balmoral_Castle.jpg" }
];
var x = images;
var element = document.getElementById("container");
element.innerHTML = x;
next();
function next() {
element.innerHTML = x;
};