replacing a dropdown menu with a text menu in javascript

后端 未结 3 1679
一个人的身影
一个人的身影 2021-01-17 04:45

I\'m trying to replace a drop down menu I have with a text field if someone chooses the \"other\" option. Right now in my code I have it replacing it with a paragraph elemen

3条回答
  •  被撕碎了的回忆
    2021-01-17 05:34

    function show_txt(arg,arg1)
    {
    if(document.getElementById(arg).value=='other')
    {
    document.getElementById(arg1).style.display="block";
    document.getElementById(arg).style.display="none";
    }
    else
    {
    document.getElementById(arg).style.display="block";
    document.getElementById(arg1).style.display="none";
    }
    }
    

    The HTML code here :

    
    
    

提交回复
热议问题