I used this code in Arduino but I don't how this onmousedown
works and what is meant location.href=/?off13
in this code:
client.println("<input type=button value=OFF style='width:150px' onmousedown=location.href='/?off13;'>");
if(readString.indexOf('12') >0)//checks for 6
{
digitalWrite(7, HIGH); // set pin 7 high
Serial.println("Led 7 On");
}
if(readString.indexOf('13') >0)//checks for 7
{
digitalWrite(7, LOW); // set pin 7 low
Serial.println("Led 7 Off");
}
The onmousedown
event occurs when a user presses a mouse button over an element.
<p onmousedown="myFunction()">Click the text!</p>
The href property sets or returns the entire URL of the current page.
location.href=URL