Currently, I am in the process of creating a stopwatch for solving Rubik's cube. Within this project, there is a div
element named "records" that is meant to display the time after a button is clicked. However, I am facing an issue where I am unable to append a p
element to this div
, and I cannot implement any CSS styling to it either.
Here is a snippet from rubik.js:
document.getElementById("records").appendChild(document.createElement("p").appendChild(document.createTextNode(`${formula.first}.${formula.second}.${formula.third}`)));
Whenever I attempt to append a child paragraph to this div
, it ends up becoming a text
element instead. Here is the CSS styling applied to the div
:
#records {
position: absolute;
bottom: 0;
right: 0;
width: calc(100% - 620px);
height: 130px;
border-top: 2px solid black;
background-color: white !important;
overflow-y: scroll;
}
It is worth noting that the two buttons ("add current time" and "remove last time") have a position
of fixed
.
Thank you for taking the time to read this.