Thad's Excercise

Code Sample for @Malik from @McHaney4

<html>

<head>

<title> Great Website  </title>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>

</head>

<body>

<h1> My favorite fruits </h1>

<ol id ="fruitlist">

</ol>

<script>

 var fruits =  ["apple","orange","banana","pineapple"];

 var list = $("fruitlist");

 $.each(fruits,function(index,value){

$("<li/>").text(value).appendTo(list);

});

 console.log(fruits);

</script>

</body>

</html>
1 Like