I have an array of items that I would like to make appear individually as divs when a link is pressed, each appearing to the right of the last one that appeared. I currently have been able to make the entire list of items in the array appear when the link is clicked however they go below each other and I would like for it to be one item at a time. I am very new to HTML and javascript so thank you in advance to anyone that can help me figure out how to do this
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>tangential headache</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
</head>
<body>
<a href="#" class="info" data-info="info1" allign= "right">+</a>
<script src="script.js"></script>
</body>
</html>
var tabs = [
"natal chart - Anthony Weiner",
"Das Kapital pdf",
"Applying ancient divination to modern intuition",
"QAnon - Wikipedia",
"ADD and ADHD - webMD",
"apply for a ted talk - google search"
],
arrayLength = tabs.length;
for (i = 0; i < tabs.length; i++){
$(".info").click(function() {
var newElement = document.createElement('div');
newElement.id = tabs[i]; newElement.className = "tabs";
newElement.innerHTML = tabs[i];
document.body.appendChild(newElement);
});
}
entire list of itemswith UL / LI html tag ? please show HTML code part for this? Is there a parent div ?