Set hidden field value in JS

How to set the hidden field value with Javascript code before you submit the form

Define your hidden field as below

Now we will see how you can change the hidden field value before you submit the form