The URL to the page is this.
And the screenshot to the questioned area is this.
I want, if the accordion has no content, then hide the accordion title itself. Empty accordion elements won't show.
I have used this script for that:
jQuery(".su-spoiler-content:empty").parent().hide();
But I can't find it doing anything.
Is there anything wrong in the above code?
try that...
document.querySelectorAll('div.su-spoiler-content').forEach(xDiv=>
{
if (xDiv.innerText.trim() === '')
xDiv.closest('div.su-spoiler').style.display = 'none'
})
It seems that you have "invisible stuff" inside your div.
I just edit as HTML in the browser and it works