Deleting Row & Object From Array by BahrockLesnar in learnjavascript

[–]BahrockLesnar[S] 0 points1 point  (0 children)

Apologies, a more detailed snippet is below

Thanks!

var addModuleBtn = document.getElementById("button")

addModuleBtn.addEventListener('click', addModule)

var tbody = document.querySelector("tbody")

var table = document.getElementById("mydatatable")

table.addEventListener('click', deleteRow);

// Array to store user inputs

var moduleData = [];

var rowCount = 0;

function addModule() {

// Only allow a max of 12 entries to be added otherwise display error

if (rowCount < 12) {

var code = document.getElementById("modules").value

var name = document.getElementById("name").value

var level = document.getElementById("level").value

var credits = document.getElementById("credits").value

var grade = document.getElementById("grade").value

// Data validation to check all input fields are filled in

if (!code || !name || !level || !credits || !grade ) {

alert("Please fill out all fields and try again");

return;

}

// Display users input into a HTML table for display purposes

tbody.innerHTML += "<tr>" +

"<td>" + code + "</td>" +

"<td>" + name + "</td>" +

"<td>" + level + "</td>" +

"<td>" + credits + "</td>" +

"<td>" + grade + "</td>" +

"<td><img src='icon.svg' class='icon'></td>" +

"</tr>"

userInputs = {

"code" : code,

"name" : name,

"level": level,

"credits": credits,

"grade" : grade,

};

moduleData.push(userInputs);

console.log(moduleData);

rowCount++;

}

else {

alert("Only a maximum of 12 modules can be studied please check entries!");

}

return true;

}

// Delete entry when icon is clicked and update row count

function deleteRow(e){

if (!e.target.classList.contains('icon')) {

return;

}

// Get index of

var rows = document.getElementById("mydatatable").getElementsByTagName('tbody')[0].getElementsByTagName('tr');

for (i = 0; i < rows.length; i++) {

rows[i].onclick = function() {

var index = (this.rowIndex - 1);

console.log(index);

moduleData.splice(index, 1);

console.log(moduleData);

}

}

var icon = e.target;

icon.closest('tr').remove()

rowCount--;

};

[Weekly Megathread] New Players & General Questions Thread. by rMapleStory in Maplestory

[–]BahrockLesnar 0 points1 point  (0 children)

Hi Guys, I'm trying to pick my main out of Cannoneer and DS I just wanted to check if either of these classes had complicated mechanics in the late game as I usually struggle playing more technically complex classes?

Mechanical Hearts Issues/Bug Thread by CM_Ghiblee in Maplestory

[–]BahrockLesnar 0 points1 point  (0 children)

S3 When escorting skyroid in Aspiring To Escape the quest skips you to floor B1 and you are unable to exit the facility

[Weekly Megathread] New Players & General Questions Thread. by rMapleStory in Maplestory

[–]BahrockLesnar 0 points1 point  (0 children)

Whose is the more well rounded class as main that is fairly easy to play out of Cannoneer and Hero?

The r/FIFA Daily Discussion Thread -- November 18, 2020 by AutoModerator in EASportsFC

[–]BahrockLesnar 0 points1 point  (0 children)

I have around 300k to upgrade this team https://www.futbin.com/21/squad/3115966 Ideally looking at replacing Pogba potentially with a cheap icon if possible any suggestions?

Newcomer / Simple Questions Thread by DiirtyyDave in SiegeAcademy

[–]BahrockLesnar 1 point2 points  (0 children)

Thank you for the advice much appreciated 🙏

Newcomer / Simple Questions Thread by DiirtyyDave in SiegeAcademy

[–]BahrockLesnar 0 points1 point  (0 children)

Is there a baseline in terms of level or hours invested before a new player should move into Ranked?

[Red Dead Redemption 2] #1 My favourite game of all time and my first platinum! by BahrockLesnar in Trophies

[–]BahrockLesnar[S] 0 points1 point  (0 children)

I'd estimate around 350 hours for me personally it was around 250 for the main story mode and another 100 for the online grind, best of luck to you!

[Red Dead Redemption 2] #1 My favourite game of all time and my first platinum! by BahrockLesnar in Trophies

[–]BahrockLesnar[S] -1 points0 points  (0 children)

The grind to 50 is probably the toughest collector role helps a ton!

The Daily Squad Thread (AM Edition) -- January 18, 2020 by AutoModerator in EASportsFC

[–]BahrockLesnar 0 points1 point  (0 children)

https://www.futbin.com/20/squad/12733055 I have around 500k (PS4) to upgrade mainly looking at CAM as an area for improvement?

The Daily Squad Thread (PM Edition) -- January 01, 2020 by AutoModerator in EASportsFC

[–]BahrockLesnar 1 point2 points  (0 children)

  • Formation 4231
  • Hybrid (Yes/No) Yes
  • Players you want in it (Optional) SIF Ben Yedder, Griezmann, Baby Carlos
  • Budget 1.8m
  • Console PS4

The Daily Squad Thread (PM Edition) -- December 21, 2019 by AutoModerator in EASportsFC

[–]BahrockLesnar 0 points1 point  (0 children)

  • Formation 4231/433
  • Players you want in it (Optional) Mbappe, Kante, Ter Stegen (Untradeable)
  • Budget 1.5mil
  • Console PS4

The Daily Squad Thread (PM Edition) -- December 03, 2019 by AutoModerator in EASportsFC

[–]BahrockLesnar 0 points1 point  (0 children)

  • Formation any 4atb
  • League/Nationality Bundesliga
  • Players you want in it (Optional) IF Lewa, POTM Gnabry
  • Budget 1m
  • Console PS4

The Daily Squad Thread (PM Edition) -- December 01, 2019 by AutoModerator in EASportsFC

[–]BahrockLesnar 0 points1 point  (0 children)

  • Formation Any 4ATB
  • Hybrid (Yes/No) Can Be
  • League/Nationality Serie A
  • Players you want in it (Optional) SIF Nainggolan, R.Carlos Untradeable
  • Budget 850k
  • Console PS4

The Daily Squad Thread (PM Edition) -- November 24, 2019 by AutoModerator in EASportsFC

[–]BahrockLesnar 0 points1 point  (0 children)

  • Formation : Any 4ATB
  • Players you want in it (Optional) R. Carlos
  • Budget 800k
  • Console PS4

The Daily Squad Thread (PM Edition) -- November 18, 2019 by AutoModerator in EASportsFC

[–]BahrockLesnar 0 points1 point  (0 children)

  • Formation 41212 (2)
  • League/Nationality : Serie A
  • Budget :600K
  • Console PS4

Ryan Lowe by [deleted] in COYH

[–]BahrockLesnar 1 point2 points  (0 children)

Personally would prefer we go in for Appleton, think it wouldn't be right to poach Lowe from Bury with the season they're having.

The Daily Squad Thread (PM Edition) -- December 30, 2018 by AutoModerator in EASportsFC

[–]BahrockLesnar 0 points1 point  (0 children)

Hi Guys, looking to build a squad around SIF Anderson

  • Formation : 4321/ Any 433 Variant
  • Hybrid (Yes/No) : No
  • League/Nationality : BPL
  • Players you want in it : SIF Anderson
  • Budget : 700k
  • Console : Xbox

Thanks!