Ajax 말고 Form 으로 전송
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>jQuery Form Submit</title> <script src="https://code.jquery.com/jquery-3.5.1.min.js"></script> <script> $(document).ready(function(){ $("#submitBtn").click(function(){ $("#myForm").submit(); // Submit the form }); }); </script> </head> <body> <form action="action.php" method="post" id="myForm"> <label>First Name:</label> <input type="text" name="first-name"> <button type="button" id="submitBtn">Submit Form</button> </form> </body> </html> |