Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #18039
| Newsgroups | comp.lang.javascript |
|---|---|
| Date | 2013-01-09 12:54 -0800 |
| Message-ID | <b7e6883d-fe02-41ca-b4e8-89cfaccde7f6@googlegroups.com> (permalink) |
| Subject | Simple question about div show or hide |
| From | justaguy <lichunshen84@gmail.com> |
Hi,
Problem with the following code for simple Div show or hide:
Second click is not possible. Tested against Firefox 17 and Chrome 23 (both on Windows 7).
What's wrong? Am I missing something obvious?
Please note, I'm using double ## here instead of a single # because the server side scripting language, ColdFusion or Railo that I'm using, consider # as a special symbol, so, I'm using double ## to escape to one.
<div><a href="##sh" onclick="if (document.getElementById('t').style.display='none'){document.getElementById('t').style.display='inline';}else{alert('2nd test click called');document.getElementById('t').style.display='none';}">test div show/hide</a></div>
<div id="t" style="display:none">test data</div>
Many thanks.
Back to comp.lang.javascript | Previous | Next — Next in thread | Find similar | Unroll thread
Simple question about div show or hide justaguy <lichunshen84@gmail.com> - 2013-01-09 12:54 -0800
Re: Simple question about div show or hide Scott Sauyet <scott.sauyet@gmail.com> - 2013-01-09 13:29 -0800
Re: Simple question about div show or hide Cezary Tomczyk <cezary.tomczyk@gmail.com> - 2013-01-09 22:44 +0100
Re: Simple question about div show or hide justaguy <lichunshen84@gmail.com> - 2013-01-09 14:25 -0800
Re: Simple question about div show or hide Richard Yates <richard@yatesguitar.com> - 2013-01-09 14:47 -0800
Re: Simple question about div show or hide Martin Leese <please@see.Web.for.e-mail.INVALID> - 2013-01-10 09:52 -0700
Re: Simple question about div show or hide Cezary Tomczyk <cezary.tomczyk@gmail.com> - 2013-01-10 21:02 +0100
Re: Simple question about div show or hide Hans-Georg Michna <hans-georgNoEmailPlease@michna.com> - 2013-01-10 18:26 +0100
Re: Simple question about div show or hide "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2013-01-10 19:37 +0100
Re: Simple question about div show or hide Danny <dann90038@gmail.com> - 2013-01-10 12:47 -0800
csiph-web