'How to create the action of javascript:alert('Form Submitted'), which will simply alert that the form was submitted?

I am new to coding. My project requires me to make the contact form have an action of a javascript:alert('Form Submitted'), which will simply alert that the form was submitted. This is my code:

<div class="contact-box">
    <h1>Contact Us</h1>
    <form>
    
        <input type="name" class="input-field" placeholder="Your Name">
        <input type="email" class="input-field" placeholder="Your Email">
        <input type="subject" class="input-field" placeholder="Subject">
        <textarea type="text" class="input-field textarea-field"
        placeholder="Your message"></textarea>

<input type="submit" value="Send Message">


</div>


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source