Hide the first element of a div
P粉278379495
2023-08-17 10:45:31
<p>I have a div that displays this text</p>
<pre class="brush:php;toolbar:false;"><address class="address address--tight">
-17.7353231,-63.1696634, Av. Block, NY00, Miami, United States
</address></pre>
<p>How can I hide the first two elements (coordinates) and only show the address, city and country? </p>
According to the code provided, you can directly get the element's
.textContent
, then.split
on,
, remove the first two parts, and then Use,
to.join
. This method is very specific though and may fail if you are not 100% sure that you always have this order and these details.