<!DOCTYPE html>
<html lang="id">
<head>
    <meta charset="utf-8">
    <title>JavaScript Event Submit</title>
</head>
<body>
    <form action="/contoh/html/action.php" method="post" onsubmit="alert(' Data formulir akan diserahkan ke server!');">
        <label>Nama Depan:</label>
        <input type="text" name="nama-depan" required>
        <input type="submit" value="Kirimkan">
    </form>
</body>
</html>

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.