Not sure about iPhone, but most browsers on Android (e.g. Chrome, Edge) let you disable JavaScript in "site settings" by default. You then opt-in for a given site by clicking the little padlock on the address bar and enabling JavaScript for the site in question. Also works for things like audio, location, etc.