Have an account? Sign in
Login  Register  Facebook
hide a specific div after login
hello noobie here.... can someone help me please regarding my problem... i want to hide a specific div.. that div is my login form then after i successfully logged in.. another will div will show.. that div is my control panel then after i logout i want to show again that login div and my i will hide again my control panel div...
Started: September 18, 2011 Latest Activity: September 18, 2011 login div
1 Answer
first if you already using any framework such as jquery you can do that by hide() and show()
but if you want it with the normal javascipt:
function showdiv(boxid){
   document.getElementById(boxid).style.visibility="visible";
}

function hidediv(boxid){
   document.getElementById(boxid).style.visibility="hidden";
}
One simple way to do this would be have to simple functions one to hide and one to show. and call them like:
<a onclick="showdiv('id_to_show'); hidediv('id_to_hide');">switch</a>

Posted: MacOS
In: September 18, 2011

Your Answer

xDo you want to answer this question? Please login or create an account to post your answer