How to control a website's on/off button through app on/off button please Help

How to fill out a form of a webpage and click a button using some JavaScript

Taifun