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
You have mistake at the end of your function - remove the last );
Finally it should be:
function change(obj) { var selectBox = obj; var selected = selectBox.options[selectBox.selectedIndex].value; var textarea = document.getElementById("text_area"); if(selected === '1'){ textarea.style.display = "block"; } else{ textarea.style.display = "none"; } }