js onclick点击事件改变皮肤

<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title>点击换</title>
        <link id="skin" rel="stylesheet" type="text/css" href="06red.css">
    </head>
    <body>
        <button onclick="toRed();">变红</button>
        <button onclick="toGreen();">变绿</button>
        
    </body>
    <script>
    function toRed()
        {
            document.getElementById('skin').href = '06red.css'
        }
        function toGreen()
        {
            document.getElementById('skin').href = '06green.css'}
        
    </script>
</html>

js onclick点击事件改变皮肤