Extension cords are legal.

In fact, they are made for just the purpose the person wishes to use them for.