Ask Sawal

Discussion Forum
Notification Icon1
Write Answer Icon
Add Question Icon

How to set visible false in javascript?

2 Answer(s) Available
Answer # 1 #
  • Make the control visible (by default should be visible)
  • hide the element using CSS style display:none; or visibility:hidden;
  • add an event listener to ddlType so when it becomes 6 you swap the style for txtOthers.
  • also disable the auto post back for ddlType.
[5]
Edit
Query
Report
Lieux Dacosse
Chief Product Officer
Answer # 2 #

The visibility property sets or returns whether an element should be visible.

The visibility property allows the author to show or hide an element. It is similar to the display property. However, the difference is that if you set display:none, it hides the entire element, while visibility:hidden means that the contents of the element will be invisible, but the element stays in its original position and size.

Return the visibility property:

Set the visibility property:

CSS tutorial: CSS Display and visibility

CSS reference: visibility property

[2]
Edit
Query
Report
Nate Sajjan
PLATE STACKER HAND