I have this div that displays this text
<address class="address address--tight">
-17.7353231,-63.1696634, Av. Block, NY00, Miami, United States
</address>
How can I hide the first two elements (the coordinates) to only show the address, city and country
2
Answers
Not possible without some JS/DOM. But ideally you should prepare the data before using it in DOM.
A regex version:
But the fastest version could be:
Based on the code provided, you can just take the
.textContent
of the element,.split
it on,
, remove the first two parts, then.join
it back with,
. This is highly specific though, and if you are not 100% you will always have this order and those details, this might fail.