Show/Hide a textbox on select dropdown menu

hello
am really struggling with jscript.

how do i get a dropdown menu to hide/show a textbox and a label control ? in a asp.net page

here is my code

function showandhide()
{
var hide = document.getElementById(‘ctl00_cphContent_record1_txtDOB’);

    if (hide == true)
  {

/// hide the textbox and label control
}
else
{
///show
}
}

var hide = document.getElementById(‘ctl00_cphContent_record1_txtDOB’);

will return only element but we need to fetch the display property of this textbox block/none.

Can you use Jquery?

I dotn know much abt javascript, just learning.

I just need a solution. Please

thanks

We’re missing something. Your script isn’t complete…

Please post the HTML… at least the form, so we can see the select dropdown and the textarea/label combo who is supposed to appear/disappear.

We need to see what your event is… people are supposed to see this label/textarea combo after they DO something, right? After making a selection from a select dropdown?

In general I prefer having all the HTML elements in the form, so those without JS can fill it in, and then add/remove a class which has CSS applied, to hide or show the thingie.