We will display a form with a listbox inside it. Once the form is submitted or input button is clicked we will be execute a function data_check() . Inside this function we will check the length of the selected option like this. First we will store the selected value in string variable.
The length of the string variable is str.length . Now using this we can submit the form or display the alert message.
Here is the code.
This article is written by plus2net.com team.