« first day (3239 days earlier)      last day (863 days later) » 

user17382064
2:05 AM
const manageUI = (function makeManageUI() {
const body = document.body;

const players = [];

function findPlayers() {
const allCovers = document.querySelectorAll(".cover");
const allWrappers = document.querySelectorAll(".wrap");
allCovers.forEach(function addToPlayers(cover, index) {
players.push({
"cover": cover,
"wrapper": allWrappers[index]
});
});
}

//callback syntax
function getWrapper(cover) {
function isCover(player) {
return player.cover === cover;
}

const index = players.findIndex(isCover);
 
1 message moved from JavaScript
 
 
3 hours later…
 
3 hours later…
7:59 AM
is that okay since the calculation seems to be working correctly?
function billSplit() {
let totalBill = document.getElementById("bill").value;
let groupSize = document.getElementById("split").value;

if (totalBill == "" || groupSize == "") {
document.querySelector("h2").innerHTML = "Missing field";
}

else if (totalBill == 0 || groupSize == 0) {
document.querySelector("h2").innerHTML = "Value cannot be zero"
}
else {
let splitTotal = (totalBill / groupSize).toFixed(2);
document.getElementById("each").textContent = `$ ${splitTotal}`;
 
@cool-peaches Please don't post unformatted code - use the up arrow to edit your post, then hit Ctrl + K to format the code in that post. See the faq. You have 25 seconds to edit and format your message properly before it will be removed. Please separate code blocks from your actual question. Put your question in 1 message and then your code in a 2nd and format it.
For posting large code blocks, use a paste site like like gist.github.com, hastebin.com, pastie.org or a demo site like jsbin.com
1 message moved from JavaScript
@cool-peaches Please don't post unformatted code - use the up arrow to edit your post, then hit Ctrl + K to format the code in that post. See the faq. You have 25 seconds to edit and format your message properly before it will be removed. Please separate code blocks from your actual question. Put your question in 1 message and then your code in a 2nd and format it.
For posting large code blocks, use a paste site like like gist.github.com, hastebin.com, pastie.org or a demo site like jsbin.com
1 message moved from JavaScript
@cool-peaches Please don't post unformatted code - use the up arrow to edit your post, then hit Ctrl + K to format the code in that post. See the faq. You have 25 seconds to edit and format your message properly before it will be removed. Please separate code blocks from your actual question. Put your question in 1 message and then your code in a 2nd and format it.
For posting large code blocks, use a paste site like like gist.github.com, hastebin.com, pastie.org or a demo site like jsbin.com
1 message moved from JavaScript
@cool-peaches Please don't post unformatted code - use the up arrow to edit your post, then hit Ctrl + K to format the code in that post. See the faq. You have 25 seconds to edit and format your message properly before it will be removed. Please separate code blocks from your actual question. Put your question in 1 message and then your code in a 2nd and format it.
For posting large code blocks, use a paste site like like gist.github.com, hastebin.com, pastie.org or a demo site like jsbin.com
@cool-peaches Please don't post unformatted code - use the up arrow to edit your post, then hit Ctrl + K to format the code in that post. See the faq. You have 25 seconds to edit and format your message properly before it will be removed. Please separate code blocks from your actual question. Put your question in 1 message and then your code in a 2nd and format it.
For posting large code blocks, use a paste site like like gist.github.com, hastebin.com, pastie.org or a demo site like jsbin.com
 
8:51 AM
💤
 
9:02 AM
10 messages moved from JavaScript
 
 
2 hours later…
 
3 hours later…
 
2 hours later…
 
6 hours later…

« first day (3239 days earlier)      last day (863 days later) »