P2 TW2 - questão 2

In this example below you will see how to do a P2 TW2 - questão 2 with some HTML / CSS and Javascript

This awesome code was written by phcacique, you can see more from this user in the personal repository.
You can find the original code on Codepen.io
Copyright phcacique ©


  • HTML
  • JavaScript
<!DOCTYPE html>
<html lang="en" >

  <meta charset="UTF-8">
  <title>P2 TW2 - quest√£o 2</title>


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

<ul id="personagens"></ul>

    <script  src="js/index.js"></script>



/*Downloaded from https://www.codeseek.co/phcacique/p2-tw2-questandxe3o-2-KymONV */
var lista = ["Harry Potter", 
			 "Rony Weasley",
			 "Hermione Granger",
			 "Albus Dumbledore",
			 "Severus Snape",
			 "Tom Riddle",
			 "Nevile Longbottom",
			 "Minerva McGonigal"];

window.onload = function(){
	for (var i=0; i<lista.length; i++){
		$('#personagens').append("<li style='color:blue'>"+lista[i]+"</li>");