Hello need some help

on my dynamic page I used a function to hide buttons if they have no content .

any ideas for how I can remove the hidden elements or get rid of the gap between the other buttons ?

$w . onReady ( function () {
$w ( “#dynamicDataset” ). onReady ( () => {
let button27 = $w ( ‘#button27’ );
let button28 = $w ( ‘#button28’ );
let button29 = $w ( ‘#button29’ );
let button30 = $w ( ‘#button30’ );
let button31 = $w ( ‘#button31’ );
let button32 = $w ( ‘#button32’ );
if ( button27 . label . length === 0 ){
button27 . hide ()
};
if ( button28 . label . length === 0 ){
button28 . hide ()
};
if ( button29 . label . length === 0 ){
button29 . hide ()
};
if ( button30 . label . length === 0 ){
button30 . hide ()
};
if ( button31 . label . length === 0 ){
button31 . hide ()
};
if ( button32 . label . length === 0 ){
button32 . hide ()
};
});

use the function . collapse ();
So it is going to be button32 . collapse () instead of button32 . hide ()

I used the collapse instead but it removed only one of them

that worked: button32 . collapse () instead of button32 . hide ().
I found the problem.
there was a little picture on the left side of the page that created the space.
I moved it and returned it back and then it worked.
thanks for your help faycal :slight_smile:

Perfect. You are welcome