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 are getting the html element by document.getElementById that returns normal javascript object. Jquery methods hide() and show() are available for jquery objects only.
But whatever you want to achieve can be achieved by simple Javascript, just made some simple changes.
instead of show() and hide() use respectively textarea.style.display = "block"
and textarea.style.display = "none"
;
and remove the );
in the end of your code.
use the fiddle link for working example. fiddle link