diff --git a/index.html b/index.html new file mode 100644 index 0000000..7fbfb0f --- /dev/null +++ b/index.html @@ -0,0 +1,51 @@ + + + + My Portofolio + + + + +
+

I'm Jose Luis Izquierdo Hernandez

+
+
+

About me

+

I am an student in Code The Dream

+
+
+

Experience

+

1 month in PSSI

+

4 month in Walmart

+
+
+

Skills

+ +
+
+

Connect

+

Email Me

+

My LinkedIn

+
+
+

Leave a Message

+
+
+
+
+ +
+
+
+

Messages

+ +
+ + + + + diff --git a/js/index.js b/js/index.js new file mode 100644 index 0000000..965f6ab --- /dev/null +++ b/js/index.js @@ -0,0 +1,46 @@ +const today = new Date(); +const thisYear = today.getFullYear(); +const footer = document.querySelector('footer'); +const copyright = document.createElement('p'); + +const skillsSection = document.getElementById('skills'); +const skills = ['HTML5', 'CSS', 'JavaScript', 'Teamwork', 'Problem Solving', 'Algorithms' ]; +const skillsList = skillsSection.querySelector('ul'); + + + +copyright.innerHTML = `Jose Izquierdo ${thisYear}`; +footer.appendChild(copyright); + +for(let i = 0; i < skills.length; i++){ + let skill = document.createElement('li'); + skill.textContent = skills[i]; + skillsList.appendChild(skill); +} + +// It didn't let me use the document.getElementsByName method in the line #22. +const messageForm = document.querySelector('form'); +messageForm.addEventListener('submit', (e) => { + e.preventDefault(); + const usersName = e.target.usersName.value; + const usersEmail = e.target.usersEmail.value; + const usersMessage = e.target.usersMessage.value; + console.log(usersName) + console.log(usersEmail) + console.log(usersMessage) + const messageSection = document.getElementById('messages'); + const messageList = messageSection.querySelector('ul'); + const newMessage = document.createElement('li'); + newMessage.innerHTML = `${usersName} wrote you ${usersMessage}`; + const removeButton = document.createElement('button'); + removeButton.textContent = 'remove'; + removeButton.type = "button"; + removeButton.addEventListener('click', (e) => { + const entry = removeButton.parentNode; + entry.remove(); + + }) + newMessage.appendChild(removeButton); + messageList.appendChild(newMessage); + messageForm.reset(); +}) \ No newline at end of file