How to get value of option selected using JavaScript In this code i will be share with you how get value from option selected using JavaScript <body> <select id="list" style="padding: 10px;" onchange="getSelectValue();"> <option value="select" disabled selected>-- select --</option> <option value="js">JavaScript</option> <option value="php">PHP</option> <option value="c#">Csharp</option> <option value="java">Java</option> <option value="node">Node.js</option> </select> <script> function getSelectValue() { var selectedValue = document.getElementById("list").value; document.body.innerHTML+=''+ selectedValue+''; } </script> </body> © Manajmnt code Share to : ☷✎ Comments
Comments
Post a Comment
message