[Solved] Help with quit button?

I am very new to unity and coding and I just saw a tutorial on how to make a quit button, and for some reason when I go to the functions of the button my script is not there.

This is the script:

using UnityEngine;
using System.Collections;
using UnityEngine.UI;

public class quit : MonoBehaviour
{
public void Doquit()
{
Application.Quit();
}
}

Have you attached the script to a gameobject and then dragged that into the button events in the inspector?

Oh I had attached the button object but I had the script on a different object it’s fixed now.