I want to remove or set css property as display:none
for the text element which has no html element or has no id or class attribute.
Please check image for reference.
You can try font-size: 0
trick.
div {
font-size: 0;
}
div * {
font-size: 1rem;
}
<div>
<span>text 1</span>
unwanted text
<span>text 2</span>
</div>