Skip to content

Commit

Permalink
javascript HTMLElement collection confusing
Browse files Browse the repository at this point in the history
  • Loading branch information
Mobmaker55 committed Sep 15, 2024
1 parent 7713bb5 commit d41f64d
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions frontend/javascript/modules/majorProjectForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,7 @@ export default class MajorProjectForm {

let skills = [];

for (const skill in document.getElementsByClassName('span[class=skill-tag]')) {
skills.push(skill.innerText)
}
Array.from(document.getElementsByClassName('skill-tag')).forEach(tag => skills.push(tag.firstChild.data))

let payload = {
projectName: this.form.querySelector('input[name=name]').value,
Expand All @@ -63,7 +61,7 @@ export default class MajorProjectForm {
projectSkills: skills,
projectDescription: this.form.querySelector('textarea[name=description]').value
};

console.log(payload)

FetchUtil.postWithWarning(this.endpoint, payload, {
Expand Down

0 comments on commit d41f64d

Please sign in to comment.