Add div id to accordion items for linking within a page

Hi,

I would like to know how to add a div id=“someId” to each item in a accordion.
(We need this for automatic scrolling to the correct position using location.href=‘#someId’ in page with a lot of accordion items)

I could of course edit the whole dhtmlxaccordion.js file and add the id tag to the this.addItem function.

But then i might forget that during a future update.

So I prefer a method setting the div id after is has been generated, like setText.
moveontop function is not a solution for us, since the order of the accordion is not allowed to be changed

Please advice…

Hi,

you can get innerHTML of this div and put it using attachHTMLString in each accordion item:

... var str = document.getElementById("someId").innerHTML; dhxAccord.cells("a1").attachHTMLString(str);

ok thank you