Hello Friends i m getting blocked with a confusing error its seems simple but i cant got it done i just want to toggle a div on clicking on an ID and change the html() of this ID like currently its showing Hide when user click on it then its show ‘show’ but in my code its not happend and the panel works fine with toggle effect Please check DEMO. Please help me
Thanks in advance ….
Hello Friends i m getting blocked with a confusing error its seems simple but
Share
You are making this MUCH more difficult than it needs to be. This is how I would do it:
But to actually explain what is wrong with your code, you want to use “else if” instead of the second “if” statement, as such:
If in your first
ifstatement, you are changing the html to “show”. Then the statement finishes, and you are saying “if html is ‘show’, change it to hide”. So then it changes to hide. In other words, it is changing from hide to show to hide. Using “else if” is what you want.