Tryit Editor v1.8

Source Code:
<!DOCTYPE html> <html> <head> <style type="text/css"> #ex1 { border: 1px solid #FF0000; } </style> <script> function displayResult() { document.getElementById("ex1").style.borderTopColor="#00FF00"; } </script> </head> <body> <div id="ex1">This is some text.</div> <br> <button type="button" onclick="displayResult()">Change color of top border</button> </body> </html>
Result:
W3Schools.com - Try it yourself