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.
Asked
Active
Viewed 462 times
0

Murlidhar Fichadia
- 2,589
- 6
- 43
- 93
-
That's inside the div tag set attribute of the div tag – Jaysmito Mukherjee Jan 25 '21 at 18:52
-
Or you can also add a apan tag around it and set it's attribute – Jaysmito Mukherjee Jan 25 '21 at 18:53
-
You could write a function in javascript that surrounds these texts with span tags and assigns random generated values at clients browser and then you can set some logic to set the attributes using setAttribute method of set style using element.style.display="none" or if you just want to remove that text useparent div .innerText ="" – Jaysmito Mukherjee Jan 25 '21 at 18:56
-
@JaysmitoMukherjee yes but this text what do I call? lets say parent div = #lg-counter then what will be the code I use? – Murlidhar Fichadia Jan 25 '21 at 19:04
-
@JaysmitoMukherjee I cannot add span around it or anything.. its auto-generated code from light gallery library. – Murlidhar Fichadia Jan 25 '21 at 19:04
-
@JaysmitoMukherjee Give me javascript code or so... I need solution.. I have tried alot of things.. – Murlidhar Fichadia Jan 25 '21 at 19:05
1 Answers
1
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>

doğukan
- 23,073
- 13
- 57
- 69