Call following functionfunction ToggleFollowingText(id) { document.getElementById(id).style.display == '' ? document.getElementById(id).style.display = 'none' : document.getElementById(id).style.display = ''; }In above function you need to pass id of the html element as the parameter.If the control is already displaying then it will hide otherwise it will be shown.
Javascript
Topic: JS Window
How to toggle display an HTML element?
Browse random answers:
What is a Window Object?
To put a "close window" link on a page ?
Can you explain about Screen object?
How to get height and width of different browser in Javascript?
What is difference between window.onload and onDocumentReady?
How to determine the state of a checkbox using Javascript?
How to get the contents of an input box using Javascript?
What is other equivalent option of document.getElementById() when you are working with Ajax?
How to toggle display an HTML element?
How to get the Scroll height and Width in JavaScript !!
How can you set position of the page (Top and Left) to 0 using Javascript in one line code?
Basic methods for opening a PopUp window using Javascript?
What is the difference of "setTimeout" function and setInterval functions in Javascript
How do you submit a form using Javascript ?
Explain with an example the use of event handlers in JavaScript.
How to open a window with no toolbar, but with the location object.
How to reload the current page
Difference between window.onload and onDocumentReady?