Code for making the comment field required on checkout page in magento 1
Note : put this code in skin/frontend/default/your_theme/js/ your_theme /opc/checkout.js
Code for making a confirm email field in Magento 1
In billing.phtml -> paste below code in billing.phtml at just below at already had email field. Then open validation.js which is located at js/prototype/validation.jsand paste below code at just below the line => return !(pass.length < 7)
How to write jquery in phtml file in magento 2
We need to write jquery sometimes in phtml file for special requirement. For that you need to define jquery in require function in script tag for using jquery within phtml file.Put below script in phtml file and replace console.log with your custom code.
How to replace or remove specific string from url in jquery.
Replacing some specific string from url is somewhat tricky job we need to do in our day to day life in IT field for making something dynamic. Here is the working solution you can try given below. Above given solution is tried and found working. If you are stuck somewhere then feel free to comment
Set interval using jquery
Set interval is very important method, which is simultaneously checks for the element if the element is exists or not. It is invoke to the time you provided in interval function, And it will continue to invoke till then the element is not found.