There is a long, long string enclosed in a div with overflow-x: scroll; . How to make a button, when clicked, the contents of the line will scroll sideways to the n-th number of pixels?

I do not need a ready answer, just a hint / hint :)

  • 2
    Element.scrollLeft. Here you can read: developer.mozilla.org/en-US/docs/Web/API/Element/scrollLeft - IonDen
  • Yes, gorgeous, this is it. Thank you very much, I could not googling :) - Vyacheslav Potseluyko
  • @lonDen make your comment a specific answer to make it easier for you to find the answer afterwards =) Thank you! - alexoander

0