I want to a script where onclick show one div and hide another all div with java script....... here number of div 1 2 3 4 5 6......n plz tell me script........
You can give your divs id like myDiv1, myDiv2, ..etc and in a for loop hide all the divs except the clicked one. You can use a code somwhat for hiding for (i = 1; i <= n; i++) { if (clickedDiv != document.getElementById('myDiv' + i)) { document.getElementById('myDiv' + i).style.display="none"; document.getElementById('myDiv' + i).style.visibility="hidden"; } } Code (markup): You should then call this method on div's onClick event and pass 'this' as parameter to the method.