Closed SayWut closed 11 months ago
That's because jobDescriptionElement
just a wrapper, in some case we should parse html correctly like this:
<foo></foo>
<bar></bar>
Either querySelector
or getElementById
would get the right element you need.
I encounter a weird behaver once I tried to use
removeChild
function. At first it didn't work but I couldn't thought why.I found out that for some reason after I parse my html some part of it has 2
HTMLElement
wrapping it for no reason. So to solve my issue I forced to use thefirstChild
property in order to make it to workFaulty code:
Working code:
index.html file:
This feels like weird behaver of the parser. I encounter it on a bigger code this is a small test that I did to check it and it did the same thing. on the other code I used
getElementById
from a bigger html page.