Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <script src="http://code.jquery.com/jquery-latest.js"></script>
- </head>
- <body>
- <div class="motor">
- <button class="run" href="#">Click to start/stop motor</button><br/>
- </div>
- <br/>
- Status : <span id="status">0</span> >>
- <span id="status2">Stopped</span><br>
- <span id="status_amp">0</span> A
- <script>
- var running = "Motor is running";
- var stopped = "Motor is stopped";
- var amp = "0,96";
- var amp_stopped = "0"
- $("button").mouseup(function(){
- var etta = 1;
- $('#status').html(etta);
- $('#status2').html(stopped);
- $('#status_amp').html(amp_stopped);
- // do post
- }).mousedown(function(){
- var nolla = 0;
- $('#status').html(nolla);
- $('#status2').html(running);
- $('#status_amp').html(amp);
- //do post
- });
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement