This question already has an answer here:
I'm an ESTA holder regularly travelling to the US to see my girlfriend. I am a UK resident, in full time employment for a UK company.
This summer, I want to go over to US for 2-3 months (up to 90 days as ESTA permits), but I'd like to carry on working for my UK company over the internet. I would get paid to my UK current account - same way as it currently is. My employer is fine with that. I would go back to the UK within 90 days - as per ESTA's terms.
Is this legal or can I get in trouble? I'm finding very contradicting answers all over the internet.
In case you wonder, I'm the software developer.