Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #33124
| Newsgroups | comp.lang.javascript |
|---|---|
| Date | 2017-04-27 17:56 -0700 |
| References | <758dd4f9-4905-4bab-91c8-f91e16c50c80@googlegroups.com> <attribute-values-20170425204220@ram.dialup.fu-berlin.de> <XnsA762E0CDD7580eejj99@194.109.6.166> |
| Message-ID | <3b23918b-e929-4f3e-8a5b-3fa6c6032610@googlegroups.com> (permalink) |
| Subject | Re: How to make the button disappear upon click? |
| From | justaguy <lichunshen84@gmail.com> |
On Tuesday, April 25, 2017 at 4:06:00 PM UTC-4, Evertjan. wrote:
> Evertjan wrote on 25 Apr 2017 in
> comp.lang.javascript:
>
> > justaguy writes:
> >>onclick=addSomething();document.getElementById(id).style.display="none"
> >
> > What seems to be the intended attribute value for the
> > »onclick« attribute is
> >
> > addSomething();document.getElementById(id).style.display="none"
> >
> > . It contains a quote character and therefore should be
> > quoted itself (see »§ 1.9. A quick introduction to HTML«
> > in »HTML 5.2 Editor's Draft, 29 December 2016«).
> >
> > (There might be other errors in this code, but I would like
> > to restrict my report to one error only.)
>
> When you make a separate function,
> all the problems with quotes disapear:
>
> ... = '<input onclick=myFunction(this)>';
>
> function myFunction(t) {
> addSomething();
> t.parentNode.style.display='none';
> };
>
>
Awesome. Thank you.
Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
How to make the button disappear upon click? justaguy <lichunshen84@gmail.com> - 2017-04-25 08:54 -0700
Re: How to make the button disappear upon click? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-04-25 22:05 +0200
Re: How to make the button disappear upon click? justaguy <lichunshen84@gmail.com> - 2017-04-27 17:56 -0700
Re: How to make the button disappear upon click? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-04-26 03:33 +0200
Re: How to make the button disappear upon click? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-04-26 10:45 +0200
csiph-web