Tryit Editor v1.8

Source Code:
<!DOCTYPE html> <html> <body> <div onmousedown="mDown(this)" onmouseup="mUp(this)" style="background-color:#D94A38;width:90px;height:20px;padding:40px;">Click Me</div> <script> function mDown(obj) { obj.style.backgroundColor="#1ec5e5"; obj.innerHTML="Release Me" } function mUp(obj) { obj.style.backgroundColor="#D94A38"; obj.innerHTML="Thank You" } </script> </body> </html>
Result:
W3Schools.com - Try it yourself