Notes:
if (tag1.innerText == "On")
samplefan2.start();
else
samplefan2.stop();