Scroll to top

Haloo! Selamat Datang di Komunitas Private Training Web Development (27644 Members, 220 Projects, 2316 Topic, 6236 Comments)

Cara mengaktifkan textbox saat memilih select box
Yuki Rizki Adam Nugraha Mengatakan : Members -
  1. <html>
  2. <head>
  3. <script type="text/javascript">
  4. function CheckColors(val){
  5. var element=document.getElementById('color');
  6. if(val=='pick a color'||val=='others')
  7. element.style.display='block';
  8. else
  9. element.style.display='none';
  10. }
  11.  
  12. </script>
  13. </head>
  14. <body>
  15. <select name="color" onchange='CheckColors(this.value);'>
  16. <option>pick a color</option>
  17. <option value="red">RED</option>
  18. <option value="blue">BLUE</option>
  19. <option value="others">others</option>
  20. </select>
  21. <input type="text" name="color" id="color" style='display:none;'/>
  22. </body>
  23. </html>
Maaf, Untuk Memberikan Komentar Anda Harus Login !!!