interviews.dotnetthread.com

↑ Grab this Headline Animator

Friday, May 9, 2008

Write a function into Javascript that will toggle display a HTML element.

- Hide Codefunction ShowHide(id)
{
document.getElementById(id).style.display == '' ? document.getElementById(id).style.display = 'none' : document.getElementById(id).style.display = '';
}We can call this function like

Show/Hide If the "divid" is already displaying on the page it will hide if not it will show on the page and so on.

Submit this story to DotNetKicks

No comments:

Post a Comment

Post your comments/questions/feedback for this Article.

 

Latest Articles