Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #18039

Simple question about div show or hide

X-Received by 10.66.84.98 with SMTP id x2mr8645372pay.10.1357764900283; Wed, 09 Jan 2013 12:55:00 -0800 (PST)
Received by 10.50.11.196 with SMTP id s4mr1254807igb.9.1357764900219; Wed, 09 Jan 2013 12:55:00 -0800 (PST)
Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!nntp.club.cc.cmu.edu!newsfeed.news.ucla.edu!usenet.stanford.edu!f6no10200380pbd.1!news-out.google.com!6ni95569pbd.1!nntp.google.com!f6no10200375pbd.1!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
Newsgroups comp.lang.javascript
Date Wed, 9 Jan 2013 12:54:59 -0800 (PST)
Complaints-To groups-abuse@google.com
Injection-Info glegroupsg2000goo.googlegroups.com; posting-host=24.149.103.139; posting-account=OqV0cQoAAADtRo2i3qWfieIZ6a02VVn5
NNTP-Posting-Host 24.149.103.139
User-Agent G2/1.0
MIME-Version 1.0
Message-ID <b7e6883d-fe02-41ca-b4e8-89cfaccde7f6@googlegroups.com> (permalink)
Subject Simple question about div show or hide
From justaguy <lichunshen84@gmail.com>
Injection-Date Wed, 09 Jan 2013 20:55:00 +0000
Content-Type text/plain; charset=ISO-8859-1
Xref csiph.com comp.lang.javascript:18039

Show key headers only | View raw


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


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