But if the user unchecks the box, the user DOESNT have to enter info in textarea.
The parentheses may include parameter names separated by commas: ( Function parameters are listed inside the parentheses () in the function definition.
Function arguments are the values received by the function when it is invoked.
Most modern browsers now support HTML5 Form Validation making it possible to validate form elements without (or before) any Java Script is triggered.
The value of a text input box (or a textarea or password input) is available using the syntax that tells you which option has been selected.
This is done using HTML5 form validation techniques and CSS, but it only validates the input format (pattern) and not the actual values.
That could be done using Ajax, but would make the CAPTCHA much easier to break.
Function names can contain letters, digits, underscores, and dollar signs (same rules as variables).The problem is that, to have the data submitted in a 'nice' format to the server, the function returns an array containing all the selected checkbox values. Again, we can make the code a lot simpler in supporting browsers: suffix tells a server side script such as PHP to accept multiple values with that name into an array.Normally you would modify this so that you could submit or not submit the form based on the number of items selected. Note that in this section we've been using the new ES6 syntax which may not be available in all browsers.It can prevent people from leaving fields blank, from entering too little or too much or from using invalid characters.User-submitted data should also be verified using a secure server-side script.
Primitive values (like 3.14 or 2014), cannot have properties and methods (because they are not objects).