Element that disappears

Describe the problem.
I have a element for stock quantity that only displays when stock is available. when not it disappears. if i select it to extract the text it keep extracting the same value regardless if it shows up or not. I see that when it shows the attribute " style changes to "display: none"