1.

Solve : CSS display error...?

Answer»
function run() {
var buttn = document.getElementById("shows")
var fac = document.getElementById("act")
var val = true
if(val=true) {
val = false
buttn.innerHTML = '[ Show ][/url]'
fac.style.display = "
NONE"
 }
else if(val=false) {
val = true
buttn.innerHTML = '[ Hide ][/url]'
fac.style.display = "block"
}

}




It hides the DIV, but then does not show it. Quote from: Bannana97 on April 10, 2009, 02:26:54
PM
<script type="text/javascript">
function run() {
var buttn = document.getElementById("shows")
var fac = document.getElementById("act")
var val = true
if(val=true) {
val = false
buttn.innerHTML = '<SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: "><SPAN style="COLOR: #000000"><SPAN style="FONT-FAMILY: ARIAL"><a href="#" onClick="run()">[ Show ][/url]</SPAN></SPAN></SPAN>'
fac.style.display = "none"
 }
else if(val=false) {
val = true
buttn.innerHTML = '<SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: "><SPAN style="COLOR: #000000"><SPAN style="FONT-FAMILY: Arial"><a href="#" onClick="run()">[ Hide ][/url]</SPAN></SPAN></SPAN>'
fac.style.display = "block"
}

}
</script>



It hides the DIV, but then does not show it.

Which DIV?

Could you provide a link to a working example so we can see for ourselves what is HAPPENING?
You have no semi-colons in that code.


Discussion

No Comment Found