-1

I'm currently working on a Cooking Recipe sharing website and there's a matter on my Likes/Dislikes system.

The matter is when I click on the link "LIKE" as you can see in this picture, the page don't stay on the same position, it directly taking me at the beginning of the page, if you have some JS code to share with me in the purpose to solve my problem, please share.

I hope you understand my point, this matter can be resolved in JS but, I'm not a JS developer

j08691
  • 204,283
  • 31
  • 260
  • 272
Nacode
  • 1
  • 3
  • 4
    Please try to include a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) when posting. It can be difficult (and sometimes impossible) to troubleshoot a problem that we cannot see or experience. – EssXTee Aug 03 '22 at 18:49
  • Here are some answers using event.preventDefault() : https://stackoverflow.com/questions/1601933/how-do-i-stop-a-web-page-from-scrolling-to-the-top-when-a-link-is-clicked-that-t – Bman70 Aug 03 '22 at 19:18

1 Answers1

-2

it is complicated to solve the problem when you don't provide any code example. However, this can be triggered from an anchor: "> which moves you to the element having id="". Or check the event function when you click on the like button.