Display code only on mobile

Hi

I have advetisement code that fits mobile size prefeclty, but it is not resposnive, so I don't want to display it on desktop. Is that somehow possible to display javascript ad code only on mobile but not on comupter?