Conditional Content question

Is it possible to have a paragraph set to be conditional and have the conditions looking for other elements existing on a page? i.e.: div’s?

for example If div a and not div b exist on a page then hide

I have a section that can overflow onto multiple pages. The last div in the section contains a signature block. I have a paragraph (1 line) at the top of the page that I want to show unless the address dive is the only thing on teh page. Then I do not want it to show.

Thanks!

One way this can be done is as follow:

  • Give the paragraph or div to be hidden or shown an ID (#test1)
  • Give DIV A an ID (#diva)
  • Give DIV B an ID (#divb)
  • Create a script which targets the selector #test1 (that is the paragraph or div to be shown or hidden)
  • The script should be something like:
if(query('#diva').length && !(query('#divb').length)){
	results.hide();
}else{
	results.show();
}

Thanks! I could not seem to get this script to work. But I did find a workaround.