how can i call this js function that is inside the method in an onclick on the button that is inside another method
<?php
class Test
{
    public function GetTest()
    {
       print $HTML = '<button onclick="$this->JavaScript( TestJS() )">OK</button>';                
    }
    public function JavaScript( $JS )
    {
        echo '
            <script>
                function TestJS() {
                    alert ("OK!");
                }
            </script>
        ';
    }
}
