Is there a way to make an element clickable but only if it has text in it?

Viewed 34

I'm creating a browser game similar to Text Twist (https://texttwist2.co/) and wanted to see if there's a way to make the divs clickable, but only if they contain text content? I've got the divs holding the letters designated as:

<div id="letter-ball-1" onclick="location.href='#';" style="cursor: pointer;"></div>

Thanks so much!

Tyson

1 Answers
Related