Link in collection list → set current page → need add link to specific section in that cms page

Hi community,

I’m trying to solve this problem. I have static page with collection list in it. There is 3 static links (i can set custom ID for them) linking to “current” cms page. I need append page section link to each link like this:

instead of

So I need to use the ID of each link at the end of the url. Anyone have jquery code for this? :slight_smile:

Thanks

Juraj

Something like this from Finsweet: https://cms-library.finsweet.com/anchor?
Or https://cms-library-howto.finsweet.com/anchor/example1?

Actually not, but thanks for reply. I need something like this:

$(‘.to-sec-page’).attr(‘href’, function(i, href) {
return href + ‘#ID-OF-BUTTON’;
});

One class for all buttons, but different IDs (each button has specific ID. Same as ID of section on a target page section).