The JavaScript solution above is great, but I would instead opt for a custom style, since :not()
is broadly supported nowadays. If you are in need of a pure CSS solution, I would use the following:
.elementor-social-icon:not([href]) {
display: none !important;
}