Javascript Calculator Issues [CLOSED]

Hey Guys,

I have just started working on the Calculator project and some issues have arised.

I have created an animation to the underscore that keeps showing and hiding to indicate that the user’s calculations should be displayed there, but:
1- How can I put the expression before the underscore?
2- I don’t want the exp. to inherit the underscore animation (I just want the underscore to have the animation)?

Would you help me? :sweat_smile:

Here’s the HTML:

<div id="screenZone">
      <div id="calculations" class="underscore">_</div>
      <div id="result">0</div>

and this is the js that I have written, till now:

const calcs = document.getElementById("calculations");
function addToScreenZone(x) {
  calcs.textContent += x;


<div id="calculations" class="underscore"></div>
.underscore {
  float: left;
  margin: 0.1rem 0 0 0.5rem;
  font-size: 1.08rem;
  animation: underscore infinite 1.2s step-end;  
1 Like

Thank you very much @pseudop! :+1:

1 Like