Overwriting overwriting parent theme JS

/* Put this in the functions.php of your child theme */

add_action( 'wp_enqueue_scripts', 'wpshout_dequeue_and_then_enqueue', 100 );

function wpshout_dequeue_and_then_enqueue() {
    // Dequeue (remove) parent theme script
    wp_dequeue_script( 'parent_script_to_modify' );

    // Enqueue replacement child theme script
    wp_enqueue_script(
        'modified_child_script',
        get_stylesheet_directory_uri() . '/js/modified-child-script.js',
        array( 'jquery' )
    );
}

Leave a Reply