You have to use like below:
function custom_register() { echo 'jQuery(document).ready(function(){alert("Learning Hooks");});';
} .
add_action('custom','custom_register'); // Too late - do_action was already called. do_action('custom'); // This is called before it will have an effect
function custom_register()
{
echo '<script>jQuery(document).ready(function(){alert("Learning Hooks");});</script>';
}
.
add_action('custom','custom_register'); // Too late - do_action was already called.
do_action('custom'); // This is called before it will have an effect