Get The longText Dropdown value using hover and alert function

<!DOCTYPE html>
<!--
 Author     : ananddw
-->
<html><body bgcolor="gray"><center>
        <h1>welcome</h1>
        <h2>Add Enquiry Form</h2>

        <table>


            <tr><td></td>
                <td><select id="short_code" onchange="getSelected(this)">
                        <option value="Select">-Select-</option>
                        <option value="Value of DropDown 1 Value of DropDown 1 Value of DropDown 1 Value of DropDown 1 Value of DropDown 1 " title="Value of DropDown 1 Value of DropDown 1 Value of DropDown 1 Value of DropDown 1 Value of DropDown 1 ">1 </option>
                        <option value="Value of DropDown 2" title="Value of DropDown 2">2</option>
                        <option value="Value of DropDown 3" title="Value of DropDown 3">3</option>
                        <option value="Value of DropDown 4 " title="Value of DropDown 4">4 </option>
                        <option value="Value of DropDown 5" title="Value of DropDown 5">5</option>
                        <option value="Value of DropDown 6" title="Value of DropDown 6">6</option>
                        <option value="Value of DropDown 7 " title="Value of DropDown 7">7 </option>
                        <option value="Value of DropDown 8" title="Value of DropDown 8">8</option>
                        <option value="Value of DropDown 9" title="Value of DropDown 9">9</option>
                    </select>
                </td>
            </tr>
           
           
           
            <tr>
                <td colspan="2" align="center">
                    <input type="submit" value="Get Value"/></td>
            </tr>
        </table>
    </center>
</body>
</html>

<script type="text/javascript">
    function getSelected(select) {
        alert(select.options[select.selectedIndex].value);
    }
</script>

Comments

Popular posts from this blog

Converting JSONArray into CSV file in java

Online Book Store Website Using Java

How to read CSV File in Java