I have a long text and want (if I choose a word before) the page to scroll to this element automatically, after pressing a button. The text where the word is in, is much longer than this, I just wanted to demonstrate my problem.
<div (click)="scrollto()">scroll to word</div>
<div id="text">lsja dflkasjdf laksj dflkasj scrollhere saldfj asljfals dfalsjölas dfasjd fajsdlfa jsdldsa fasl falsd flasf</div>
.ts file:
scrollto() {
const word = 'scrollhere';
what do I have to write in the Typescript code to let the page scroll to the word 'scrollhere'?