title: How to add a horizontal line above the button upon button click
body: <p>I am currently working with a bootstrap menu that has a dropdown element upon button click. </p>
  
  <p><a href="https://i.stack.imgur.com/Rzsm0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Rzsm0.png" alt="enter image description here"></a></p>
  
  <p>I want to make the horizontal line appear upon click but can't do so with border on a click function as this pushes the content down. </p>
  
  <p>I tried with a pseudo element <code>:before</code>, however have not seen any solutions on how to add a pseudo element with a on click function in JS. </p>
  
  <p>If anyone has any solutions please let me know.</p>