Clearing a form after submitting a message?

  • 0
    Help me, how to get the form to clear after submitting a message?

    $(document).ready(function() {
    	
    		$("#submit").on("click", function() {
    		
    			var name = $("#name").val();
    			var email = $("#email").val();
    			var message = $("#message").val();
    			
    			$.ajax({
    			
    				url: "/form.php",
    				type: "post",
    
    				data: {
    					"name": name,
    					"email": email,
    					"message": message
    				},
    
    				success: function(data) {
    				
    					$(".result").html(data);
    					
    				}
    				
    			});
    			
    		});
    		
    	});
    JavaScript Anonymous, Mar 24, 2020

  • 1 Answers
  • 0
    The form has a reset emnip method
    Anonymous

Your Answer
To place the code, please use CodePen or similar tool. Thanks you!