Checking Vowels In Array [closed]

1

I’m having trouble checking vowels in the array, if every 2 col and 2 row all the letters include vowels, then the output will be incremented, the example output from this image is 3,the first function is in charge of randomizing letters and inserting them into an array, then I have a problem in the next function, the next function is in charge of capturing the results of the first function and looking for vowels based on, 2 row and 3 col, if found then the output will be incremented.

function random(row,col) {
    let hasil = []
    let vrb = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
    for (let i = 0; i < row; i++) {
        let temp = []
        for (let j = 0; j < col; j++) {
            temp.push(vrb.charAt(Math.floor(Math.random() * vrb.length)))
        }

        hasil.push(temp)
    }
    return hasil
}

// console.log(random(5,4));

function getBlock(vokal) {
    let vrb = vokal.Map
    // console.log(vrb);
}

console.log(getBlock([
    ['A', 'X', 'C', 'Y'],
    ['E', 'O', 'O', 'S'],
    ['I', 'U', 'I', 'N'],
    ['M', 'Y', 'O', 'E'],
    ['P', 'D', 'A', 'I']
]));

Get Name of SubGrid on Account Form that Triggers Javascript on the Contact Quick Create Form OnLoad

There is a subgrid on a account form that allows you to quick create a contact (contact quick create form). OnLoad of the quick create form, I need to be able to identify what subgrid triggered the quick create form as there are many on the form.

I currently have the javascript as follows that triggers on the contact quick create form onLoad:

function contactQuickCreateFormOnLoad(context)
{
debugger;

//alert("hello world");

var formContext = context.getFormContext();

var control = formContext.getControl();

}

Am I approaching this correctly as I need to get perhaps the name of the subgrid that triggered the quick create form to load? Is this the correct scope?

I ask this because the above code seems to only allow me to see the actual controls on the quick create form. I can’t locate any metadata pertaining to the subgrid that triggered this.

Any suggests would be great.

Regards.

Returning a result from an asynchronous function call [duplicate]

 async function checkStreamStatus(channelName) {
  const response = await  fetch(`https://api.twitch.tv/helix/streams?user_login=${channelName}`,  {

    headers: {
      'Authorization': 'Bearer ' + '',
      'Client-Id': '',
      
    }});

  const json = await response.json();
  const type = json.data[0]?.type;
  
  status = type;
  //console.log("worked " + status)
  
  if (status === "live") {
    return true;
  }
  else {
    return false;
  }
  
  
 }

My brain couldn’t handle how async function works even i watched 3 videos and spent 3 hours how can i return true and false from this function

enter image description here

Returning values from a Promise to a React Component using Electron and contextBridge and sqlite3

I am trying to connect a SQLite3 database with a react component using electron contextBridge and continue to return a promise {<pending>} in my frontend react component. I have rapped my SQL call in a new Promise.

Quotes_mgr.js

exports.getActiveQuoteData = () => {
  return new Promise(( resolve , reject ) => {
    db.serialize(() => {
        db.all(
          "SELECT * FROM Quotes ",
          (err, rows) => {
            if (err) reject(err);
            resolve(rows);
          }
        );})
      }) 
};

This function is called with electrons ipcMain.handle in my main.js file.

main.js

  ipcMain.handle("get_active_quotes", (event) => {
    return Quotes_mgr.getActiveQuoteData();
    //return Employee_mgr.getEmployeeid(args);
  });

through the contextBridge api in the preload.js file.

preload.js

contextBridge.exposeInMainWorld("api", {
  on(eventName, callback) {
    ipcRenderer.on(eventName, callback);
  },

    getActiveQuotes: () => ipcRenderer.invoke("get_active_quotes"),
});

Then returns the SQL results to my React component.

index.jsx

const getInStore_List = async () => {
    return await window.api.getActiveQuotes();
  }
  const InStore_List = getInStore_List()

InStore_List returns a promise {<pending>} containing the SQL results but I need it to return the SQL results so i can use them in my React component. I am new to Promises and Async functions and believe that the problem is in my new Promise implantation but have not been able to figure out why this is not working. Any help would be appreciated.

How include more variables to show and hide icon

I Have the following script that works fine just for one div (“dois”), but I want to include another divvariable for this code. How would be this code to work properly for 2 divs?

document.getElementById("_bar_Id_").onclick = function(c) {
  var x = document.getElementById("dois");
  if (x.style.visibility === "hidden") {
  x.style.visibility = "visible";
  } else {
    x.style.visibility = "hidden";
    }
  }

How to handle “node:” URIs when using create-react-app

When installing an ESM module through NPM my React app throws the following errors for all Core NodeJS modules.

Module build failed: UnhandledSchemeError: Reading from "node:fs" is not handled by plugins (Unhandled scheme).
Webpack supports "data:" and "file:" URIs by default.
You may need an additional plugin to handle "node:" URIs.

I understand why this error occurs, However I haven’t found a definite and recent solution on how to add Core NodeJS module support to a React app.

How can I add support for these core modules? Using create-react-app.

Is there any way to allow javascript change a html select option after submitting a form?

So the idea is to click a product, which is displayed on a <div>, and change the select selected value.

This works completely fine before sending the form, but after doing it, the JS won’t work.

What am I missing?

This is my code:

const changeSelected = (d) => {
  const productStack = d.querySelectorAll(".product");
  for (const product of productStack) {
    product.addEventListener("click", function() {
      d.forms["products-form"].children[0].value = this["id"];
    });
  }
};

const handleSubmit = (d) => {
  d.forms["products-form"].addEventListener("submit", function(e) {
    e.preventDefault();
    const selectedItem = d.getElementById(this["comic-select"].value);
    let data = {
      title: selectedItem.children[0].innerText,
      name: selectedItem.children[1].innerText,
      price: selectedItem.children[2].innerText.slice(0, -1),
    };
    data = JSON.stringify(data);
    data = btoa(unescape(encodeURIComponent(data)));
    if (this["product_data"]) this.product_data.remove();
    this.insertAdjacentHTML(
      "afterbegin",
      `<input type="hidden" name="product_data" value="${data}"/>`
    );
    this.submit();
  });
};

document.addEventListener("DOMContentLoaded", function() {
  changeSelected(this);
  handleSubmit(this);
});
<div class="product" id="avg-product">
  <h1 class="avg">Lorem ipsum</h1>
  <p class="avg">Lorem ipsum</p>
  <p class="avg">Lorem ipsum</p>
</div>


<form autocomplete="off" name="products-form" id="products-form" action="?c=payments&a=confirmPayment" method="POST">
  <select name="comic-select" id="comic-select">
    <option id="option-avg-product" value="avg-product">data1</option>
    <option id="option-dd-product" value="dd-product">data2</option>
    <option id="option-spd-product" value="spd-product">data3</option>
  </select><br>
  <input type="submit" value="Comprar">
</form>

React Dom Routes not working as intended, changes the path but nothing on the page

I am making a webplatform working with the OpenLibrary API, I am pulling data from the subjects then when you click on one of the books in the subjects, I want to be taken to a page called ‘Book’ where I display the data.
Now I have set up my Routes (i think they’re correct), but when I click one of the items in the list, it doesn’t do anything, it changes the URL to the route I set up, but it doesn’t take me to the Book component where I display the data. Now, I haven’t posted my Book.js file because it just has test code in it to see if I can get to the component. Any help will be appreciated!

Here are some snippets of my code:

App.js:

import React, { useState, useEffect } from "react";
import axios from "axios";

import Works from "./components/Works";
import Navbar from "./components/Navbar";
import Footer from "./components/Footer";

import "./styles.css";

function App() {
  const [subjects, setSubjects] = useState([]);
  const [worksDetails, setWorkDetails] = useState([]);
  const [isLoading, setIsLoading] = useState(false);
  const url = "https://openlibrary.org/subjects/animals.json?limit=10";
  useEffect(() => {
    axios
      .get(url)
      .then((response) => {
        setSubjects(response.data);
        setWorkDetails(response.data.works);
        setIsLoading(true);
      })
      .catch((error) => {
        console.log(error);
      });
  }, []);

  if (!isLoading) {
    return <p>Loading...</p>;
  } else {
    return (
      <>
        <Navbar />
        <div className="contentHeader">
          <h1 className="subjectHeader" style={{ padding: "10px" }}>
            Subject: {subjects.name.toUpperCase()}
          </h1>
          <h1 className="workHeader" style={{ padding: "10px" }}>
            Work Count: {subjects.work_count.toLocaleString()}
          </h1>
        </div>
        <div>
          <Works works={worksDetails} />
        </div>
        <Footer />
      </>
    );
  }
}
export default App;

Works.js

import React from "react";
import { Link } from "react-router-dom";
import Book from "../routes/Book";

const Works = (props) => {
  return (
    <div className="container">
      <div>
        <div className="heading">
          {props.works.map((work) => {
            return (
              <Link to={`/book/${work.key}`} element={<Book />} key={work.key}>
                <ul>{work.title}</ul>
              </Link>
            );
          })}
        </div>
      </div>
    </div>
  );
};

export default Works;

Index.js

import { createRoot } from "react-dom/client";
import "./index.css";
import { BrowserRouter, Routes, Route } from "react-router-dom";

import App from "./App";
import Book from "./routes/Book";

const rootElement = document.getElementById("root");
const root = createRoot(rootElement);

root.render(
  <BrowserRouter>
    <Routes>
      <Route path="*" element={<App />} />
      <Route path="/book" element={<Book />}>
        <Route path=":bookId" element={<Book />} />
      </Route>
    </Routes>
  </BrowserRouter>
);

getElementById returns null (chrome extension)

I’m new to web dev and I’m trying to make a chrome extension which skips to a certain point in a video.
But when I run this code, it returns null, and I’m unsure how to fix it.

Error message
enter image description here

manifest.json

  "manifest_version": 2,
  "name": "AniSkip",
  "description": "adds skip button",
  "version": "1.0",
  "icons": {
    "16": "/images/icon.jpg",
    "48": "/images/icon.jpg",
    "128": "/images/icon.jpg"
  },
  "page_action":{
    "default_icon":{
      "16": "/images/icon.jpg",
      "48": "/images/icon.jpg",
      "128": "/images/icon.jpg"
    }
  },
  "content_scripts" : [{
    "all_frames": true,
    "matches": ["https://animixplay.to/*"],
    "css": ["main.css"],
    "js": ["button.js"]
    }],
    "permissions": ["activeTab"]
}

button.js

let btn = document.createElement("button");
btn.innerHTML = "Save";
btn.classList.add("s_button");

btn.onclick = function () {
  var video = document.getElementById('player1');

  console.log(video);
  video.currentTime = 30;

};

document.body.appendChild(btn);

Saving images uploaded using ImagesLoader

I am trying to wire up the ImagesLoader plugin, which allows uploading multiple images. It has a nice drag-n-drop UI but I just can’t figure out how to get the images that were uploaded. I cannot find any documentation.

Link to the plugin page: ImagesLoader

Here is the javascript from the demo:

  <script type="text/javascript">

// Ready
$(document).ready(function () {

  // Create image loader plugin
  var imagesloader = $('[data-type=imagesloader]').imagesloader({
    minSelect: 3
   ,imagesToLoad: [{"Url":"./img/Nespresso001.jpg","Name":"Nespresso001"},{"Url":"./img/Nespresso002.jpg","Name":"Nespresso002"}]
  });

  //Form
  $frm = $('#frm');

  // Form submit
  $frm.submit(function (e) {

    var $form = $(this);

    var files = imagesloader.data('format.imagesloader').AttachmentArray;
    var il = imagesloader.data('format.imagesloader');

    if (il.CheckValidity())
      alert('Upload ' + files.length + ' files');        

    e.preventDefault();
    e.stopPropagation();
  });

});

The images are saved in the object “files”. Here is a screen shot of the contents from the inspector:

Inspector

I tried converting to json and posting, but that only generates an error.

            $.ajax({
                url: 'process-images.php',
                type: 'POST',
                data: JSON.stringify(files),
                contentType: 'application/json; charset=utf-8',
                dataType: 'json',
                cache: false,
                error: function() {alert("ERROR");},
                success: function() {alert("OK");}
            });

The rest of the code works just like the demo. Looks like everything needed for the uploaded images is stored in “files”. I just need to get the data back to php and I can pull it apart from there. But right now, the original submit code just dies or my addition aborts with an error.

THANKS!

Manifest is not valid JSON. Line: 1 , column 1, Unexpected token error

I’m trying to load an unpacked manifest.JSON file into Chrome extensions, but I keep getting the error: Manifest is not valid JSON. Line: 1, column: 1, Unexpected token. I’ve attached the coding and any help would be much appreciated!

{
    "name": "Starred Apps",
    "description": "save and star important websites, like bookmarks but cleaner",
    "version": "1.0",
    "manifest_version": 3,
    "background": {
      "service_worker": "background.js"
    },
    "permissions": ["storage"]
  
  }

and I’m not sure if this matters, but here is the background.js file

let color = "#3AA757";

chrome.runtime.onInstalled.addListener(()=> {
chrome.storage.sync.set({color});
console.log('Default background color set to ${color}');
});

how do I show my data in a chart in react?

i’m new to react. i am a backend developer(started recently) and we have to work with react. the backend is written with go.
there is a place in the page where you chose a start date and an end date and a device name and then in a chart it shows you the logs from the device from the timeframe that were saved in the database.
i’ve written the function where it sends the data to backend and i don’t know how to use the response. the response is supposed to send a repeated type of struct.

message DeviceLog{
  google.protobuf.Timestamp device_time = 1;
  google.protobuf.Timestamp server_time = 2;
  uint32 humidity = 3;
}

message DeviceDataFrame {
  uint32 device_id = 1;
  string device_serial = 2;
  repeated DeviceLog device_logs = 3;
}

these are my proto messages. DeviceDataFrame is the response that is being sent.

rpc GetDeviceDataFrameBySerial (messages.log.GetDeviceDataFrameBySerialRequest) returns (messages.log.DeviceDataFrame) {
    option (google.api.http) = {
      post: "/device/logs/serial"
      body: "*"
      // checked!
    };

and in my page in the frontend side this have been made.

<button
          className="chooseDeviceButton"
          onClick={() => {
            if (document.getElementById("reportDevice").value.length > 0) {
              if (startTime.length > 0 && endTime.length > 0) {
                fetch(
                  "http://asap.carriot.ir:8000/water/logs/create/serial",

                  {
                    method: "POST",
                    headers: {
                      Authorization: "Bearer " + cookies.get("token"),
                      "content-type": "application/json",
                    },
                    body: JSON.stringify({
                      device_serial:
                        document.getElementById("reportDevice").value,
                        start_date: new Date(startTime).toISOString(),
                        end_date: new Date(endTime).toISOString(),
                      step: 3,
                    }),
                  }
                ).then((res) => {
                  if (res.status === 200) {
                    //alert("report added successfully");

                    setUFCheck(res);
                  } else {
                    alert("an error occurrednERROR CODE : " + res.status);
                  }
                  //console.log(res);
                });
              } else {
                alert("please fill the data");
              }
            } else {
              alert(
                "you have no devicesn"
              );
            }
          }}
        >
          show
        </button>

i think i need to change the res part where it converts the response into something that is compatible with the chart’s code.
this is what i have found:

const data = [
    {
      "id": "Serie 1",
      "data": [
        {
          "x": 2000,
          "y": 2
        },
        {
          "x": 2001,
          "y": 9
        },
        {
          "x": 2002,
          "y": 2
        },
        {
          "x": 2003,
          "y": 4
        },
        {
          "x": 2004,
          "y": 6
        }
      ]
    }
  ];
   
    <div
      style={{
        backgroundColor: "#fff",
        width: "70%",
        borderRadius: 14,
        marginTop: 14,
        paddingLeft: 14,
      }}
    >
      <h3 style={{ color: "#00aaff" }}>Humidity Report</h3>
      <div style={styles}>
    <h1>Nivo basic demo</h1>
    <div style={{ height: "400px" }}>
    <ResponsiveBump
        data={data}
        xPadding={0.3}
        xOuterPadding={0.2}
        yOuterPadding={0.6}
        colors={{ scheme: 'brown_blueGreen' }}
        lineWidth={3}
        activeLineWidth={6}
        inactiveLineWidth={3}
        inactiveOpacity={1}
        startLabelTextColor={{ from: 'color', modifiers: [] }}
        pointSize={0}
        activePointSize={20}
        inactivePointSize={8}
        pointColor={{ theme: 'background' }}
        pointBorderWidth={3}
        activePointBorderWidth={3}
        pointBorderColor={{ from: 'serie.color' }}
        axisTop={{
            tickSize: 5,
            tickPadding: 5,
            tickRotation: 0,
            legend: '',
            legendPosition: 'middle',
            legendOffset: -36
        }}
        axisBottom={{
            tickSize: 5,
            tickPadding: 5,
            tickRotation: 0,
            legend: '',
            legendPosition: 'middle',
            legendOffset: 32
        }}
        axisLeft={{
            tickSize: 5,
            tickPadding: 5,
            tickRotation: 0,
            legend: 'ranking',
            legendPosition: 'middle',
            legendOffset: -40
        }}
        margin={{ top: 40, right: 100, bottom: 40, left: 60 }}
        axisRight={null}
    />   </div>
  </div>
      
    </div>
  

the divs are in a function i just took out the code. the chart code works on its own. i have tested it however i dont know how to convert the response into something like const data. i have googled it but i couldnt find any answers.
also disclaimer i did not write this part of the react code. i do not understand it very well either and since we have to present our project tomrrow i dont have the time to change any major part of it. please help me and be kind i am here to learn.

Unable to fix package vulnerability (svg-sprite-loader)

Running npm audit finds 4 vulnerabilities and suggests forcing a breaking change to svg-sprite-loader (reverting it from v6 back to v2??).

That fixes one vulnerability, but the remaining 3 don’t seem to be affected by running npm audit fix as suggested. I’m at a loss how to fix it.

npm: 8.10.0
Node: 16.14.0
webpack: 5.72.1
svg-sprite-loader: 6.0.11

The audit report before running npm audit fix --force:

postcss  <7.0.36
Severity: moderate
Regular Expression Denial of Service in postcss - https://github.com/advisories/GHSA-566m-qj78-rww5
fix available via `npm audit fix --force`
Will install [email protected], which is a breaking change
node_modules/postcss
  svg-baker  >=1.2.5
  Depends on vulnerable versions of postcss
  node_modules/svg-baker
    svg-baker-runtime  >=1.4.0-alpha.10475b37
    Depends on vulnerable versions of svg-baker
    node_modules/svg-baker-runtime
      svg-sprite-loader  >=2.0.4
      Depends on vulnerable versions of svg-baker
      Depends on vulnerable versions of svg-baker-runtime
      node_modules/svg-sprite-loader

4 moderate severity vulnerabilities

The report after npm audit fix --force

postcss  <7.0.36
Severity: moderate
Regular Expression Denial of Service in postcss - https://github.com/advisories/GHSA-566m-qj78-rww5
fix available via `npm audit fix`
node_modules/postcss
  svg-baker  >=1.2.5
  Depends on vulnerable versions of postcss
  node_modules/svg-baker
    svg-baker-runtime  >=1.4.0-alpha.10475b37
    Depends on vulnerable versions of svg-baker
    node_modules/svg-baker-runtime

3 moderate severity vulnerabilities

As said, running npm audit fix doesn’t fix those vulnerabilites, and I don’t really know how to deal with them. Would appreciate someone taking a look who might understand the problem better than I do

Why aren’t all my letters showing up in my hangman javascript game?

This is my first post here so excuse my formatting if it’s incorrect. I am building a hangman game and I am getting the letters to replace my underscores UNLESS its a double letter.

example: cheese returns only c h e _ s _

I have attached my code below:

const inputButton = document.querySelector("#wordInput")
const startButton = document.querySelector(".startButton")
const guessHere = document.querySelector(".guess")
const letters = document.querySelector(".letters")
let empty = ""
const letterA = document.querySelector("#A")
const alphabet = document.querySelectorAll(".letter")
let inputVal = ''
console.log(inputVal)
const wrongLetters = document.querySelector(".wrongLetters")
let wrongCounter = [];
let winCount = 0;
console.log(`win count is ${winCount}` )
let loseCount = 0;
console.log(`lose count is ${loseCount}`)


//-------------START BUTTON----------------------------------------------//

startButton.addEventListener("click", ()=>{
    inputVal = inputButton.value
    let chars = inputVal.split("")
    for(let i=0; i<chars.length;i++){
        const hiddenLetter = document.createElement("span")
        hiddenLetter.classList.add("input-letters")
        hiddenLetter.id = i
        hiddenLetter.innerText = "_"
        hiddenLetter.style.marginRight = "15px"
        // const hiddenChar = document.createElement("p")
        // hiddenLetter.appendChild(hiddenChar)
        // console.log(hiddenLetter)
        // hiddenLetter.innerText = "_ "
        letters.appendChild(hiddenLetter)
        // hiddenLetter.style.height = "5px";

        hiddenLetter.style.fontSize = "50px";
       
    }
    const startingMinutes = 2;
let time = startingMinutes * 60;
const countdownEl = document.querySelector("#countdown")
let refreshIntervalid=setInterval(updateCountdown, 1000);
let once = false;
 function updateCountdown() {
    const minutes = Math.floor(time / 60);
    let seconds = time % 60;
    seconds = seconds < 10? "0" + seconds : seconds;
    countdownEl.innerHTML = `${minutes}: ${seconds}`;
    time--;
    if (time < 0) { //stop the setInterval whe time = 0 for avoid negative time
        alert("Game Over")
        clearInterval(refreshIntervalid);
    }
    once = true;


}
})
const hiddenChar = document.createElement("span")
const revealLetter = (e) =>{
    // inputVal = inputButton.value
    // console.log(inputVal);
    let chars = inputVal.split("")
    // console.log(chars)
    let guessedLetter = e.target.id.toLowerCase()
    console.log(guessedLetter);
    let index = chars.indexOf(guessedLetter)
    if (chars.includes(guessedLetter)){
        // console.log("Letter exists", guessedLetter);
        // console.log(chars.indexOf(guessedLetter));
        let underlines = document.querySelectorAll(".input-letters")
        underlines.forEach(span =>{
            // console.log("span id: ", typeof span.id);
            // console.log("index: ", typeof index);
            if(parseInt(span.id) === index){
                console.log("Match!");
                span.innerText = guessedLetter
                winCount++
                console.log(winCount)
                e.target.remove()
                if(winCount===chars.length){
                    alert("You won the Game!")

                }
                

            }
            
        })
    }else{
        wrongCounter.push(guessedLetter)
        wrongLetters.innerText = wrongCounter
        loseCount+=1
        console.log(loseCount)
        e.target.remove()
        if(loseCount>=5){
            alert("Game Over!")
        }
        

    }
    // for(let i = 0; i < chars.length; i++){
    //         const hiddenChar = document.createElement("span")
    //         console.log(hiddenChar)
    //         hiddenChar.innerText = chars[i] + " "
    //         letters.appendChild(hiddenChar)
    //         hiddenChar.style.fontSize = "50px"
    //         hiddenChar.style.visibility = "hidden"
    //         // "visible"
    //         // "hidden"
    //         if (chars[i]==("")){
    //             hiddenChar.style.visibility = "visible"
    //         }
    // }
}

alphabet.forEach(letter=>{
    letter.addEventListener("click", revealLetter)
})
body{
    background-color: #ffe4c4;
    display:flex;
    flex-direction: column;
    flex-wrap: wrap;
}
.playerOne{
    border-style: double;
    border-width: 1em;
    text-align: center;
     height: 200px;
}
.wrongLettersBox{
    border-style: double;
    border-width: 1em;
    width: 200px;
    height: 300px;
   
    text-align: center;
    
    
}
.container{
    display: flex;
}
#wordInput{
    /* transform: translate(574px, 43px); */
    color: black;
    text-transform: uppercase
}


.startButton{
    /* transform: translate(572px, 43px); */
}
.enterWordHere{
    /* transform: translate(588px, 31px); */
}
.guess{
    text-align: center;
    border-style: double;
    border-width: 1em;
    width: 828px;
    height: 300px;
}
.image{
    border-style: double;
    border-width: 1em;
    height: 300px;
    width: 300px;
}
.alphabet{
    display: flex;
    flex-direction: row;
    justify-content: space-around;
    align-items: center;
}
.letter{
    height: 50px;
    width: 50px;
    border-style: dashed;
    text-align: center;
    background-color: rgb(200, 149, 60);
    color: rgb(242, 242, 242);
}
#countdown{
    font-size: 20px;
    color:red;
}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="style.css">
    <title>Document</title>
</head>
<div class="playerOne">
    <h1 class="snowMan_Name">Snowman</h1>
    <h3 class="enterWordHere">Enter your word here:</h3>
    <input type="text" id="wordInput" name="wordInput">
    <button class="startButton">Start</button>
    <p id="countdown"></p>
</div>
<div class="container">
    <div class="image">
        <h3>Image goes here!</h3>
    </div>
<div class="guess">
    <h3>Guess Here!</h3>
    <div class="letters"></div>
    
</div>

<body>
    <div class="wrongLettersBox">
        Wrong Letters
        <div class="wrongLetters"></div>
    </div>
</div>
<div class="alphabet">
<div class="letter" id="A">A</div>
<div class="letter" id="B">B</div>
<div class="letter" id="C">C</div>
<div class="letter" id="D">D</div>
<div class="letter" id="E">E</div>
<div class="letter" id="F">F</div>
<div class="letter" id="G">G</div>
<div class="letter" id="H">H</div>
<div class="letter" id="I">I</div>
<div class="letter" id="J">J</div>
<div class="letter" id="K">K</div>
<div class="letter" id="L">L</div>
<div class="letter" id="M">M</div>
<div class="letter" id="N">N</div>
<div class="letter" id="O">O</div>
<div class="letter" id="P">P</div>
<div class="letter" id="Q">Q</div>
<div class="letter" id="R">R</div>
<div class="letter" id="S">S</div>
<div class="letter" id="T">T</div>
<div class="letter" id="U">U</div>
<div class="letter" id="V">V</div>
<div class="letter" id="W">W</div>
<div class="letter" id="X">X</div>
<div class="letter" id="Y">Y</div>
<div class="letter" id="Z">Z</div>
</div>

<script src="script.js"></script>    
</body>
</html>

Basically I think what is happening is that the computer is getting the ids and comparing them. But once its a duplicate letter like double “A” its getting the first letter A and skipping the rest.