Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <select id="sel" onchange='myFunction()'>
- <option value="car">1</option>
- <option value="bike">2</option>
- <option value="cycle">3</option>
- </select>
- <button onclick='selectChange()'>Click me</button>
- <p id="demo"></p>
- <script>
- function myFunction() {
- document.getElementById("demo").innerHTML = "Hello World";
- }
- function selectChange(){
- document.getElementById('sel').value = "bike";
- }
- </script>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement