How to reset HTML form by javascript and jQuery

Some time in form handling we need to reset form after completing one process. For example we submit form with ajax and after successfull reply we need to reset form for new fresh entry. Example given for reset html form using jQuery and core JavaScript.

We can do this by two ways:

1) jQuery for reset form:

$('#formId')[0].reset();

2) Pure javascript for reset form:

document.getElementById('formId').reset();

Below is example for reset form by both ways.
Form 1

Person name:
Age:
Gender: Male
Female
Programmin language: PHP
jQuery

Form 2

Person name:
Age:
Gender: Male
Female
Programmin language: PHP
jQuery

Reset form 1 with javascript  
Reset form 2 with jQuery