Electric fences are made for the animals not to approach them to escape the enclosed territory.
In this video we will see a goat wishing to eat from the grass that grows under the fence.
but when he touches the fence he realizes he has done something wrong and sure he will not come closer.