Note: In the script code we have given name as 'label', so that it will find the elements of label in the HTML code.