I have a web page that isn't working the way I need it to. My question is: Can you call a PHP function from an "onclick" attribute? Below is my code and nothing is happening when I click on a menu link. The variable $rootDir is defined at the top of my page before the <!doctype html> statment.

Code:
    <body>
        <header>
            <div class="main">
                <label style="width: 85%">Blake McKenna</label>
                <label style="width: 85%" class="position">Senior Software Developer</label>
                <img src="images/Me1.jpg" width="100" alt="Blake McKenna">
                <div class="fakeHr"></div>
                <a class="linkedIn" target="_blank" href="https://www.linkedIn.com/in/blake-mckenna">LinkedIn Profile</a>

                <ul>
                    <li onclick="<?php checkMenuOption(1); ?>" <a class="menu" href="#">Summary</a></li>
                    <li onclick="<?php checkMenuOption(2); ?>" <a class="menu" href="#">Technical Skills</a></li>
                    <li onclick="<?php checkMenuOption(3); ?>" <a class="menu" href="#">Experience</a></li>
                    <li onclick="<?php checkMenuOption(4); ?>" <a class="menu" href="#">Education</a></li>
                    <li onclick="<?php checkMenuOption(5); ?>" <a class="menu" href="#">Certifications</a></li>
                    <li onclick="<?php checkMenuOption(6); ?>" <a class="menu" href="#">Contact Me</a></li>
                </ul>
            </div>
        </header>

        <div id="frame" class="dframe">
            <?php 
                function checkMenuOption($opt = 1) {
                    
                    echo "opt = " . $opt;
                    
                    switch($opt) {
                        case 1:
                            include $rootDir . "/pages/summary.php";
                        case 2:
                            include $rootDir . "/pages/skillset.php";
                        case 3:
                            include $rootDir . "/pages/experience.php";
                        case 4:
                            include $rootDir . "/pages/education.php";
                        case 5:
                            include $rootDir . "/pages/certifications.php";
                        case 6:
                            include $rootDir . "/pages/contact.php";
                    }
                }
            ?>
        </div>
    </body>
Not sure what I'm doing wrong. I event tried not using quotes like below:

Code:
                <ul>
                    <li onclick=<?php checkMenuOption(1); ?> <a class="menu" href="#">Summary</a></li>
                    <li onclick=<?php checkMenuOption(2); ?> <a class="menu" href="#">Technical Skills</a></li>
                    <li onclick=<?php checkMenuOption(3); ?> <a class="menu" href="#">Experience</a></li>
                    <li onclick=<?php checkMenuOption(4); ?> <a class="menu" href="#">Education</a></li>
                    <li onclick=<?php checkMenuOption(5); ?> <a class="menu" href="#">Certifications</a></li>
                    <li onclick=<?php checkMenuOption(6); ?> <a class="menu" href="#">Contact Me</a></li>
                </ul>