Show and hide html element on selected option change

前端 未结 10 1602
耶瑟儿~
耶瑟儿~ 2021-01-12 04:31

In a JSP page, I have a dropdown list. When the first element of the list is selected, I want a text area to show right on click. I\'m new to Javascript/Jquery, so I\'m obvi

10条回答
  •  迷失自我
    2021-01-12 04:53

    you can do this in jQuery.....like " $(document).ready(function(){

    var seletVal=$('#show option:selected').val();
    if(selectVal=='1')
    $('#textareaId').show();
    else
    $('#textareaId').hide();
    });
    

    "

提交回复
热议问题