Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #33118
| Newsgroups | comp.lang.javascript |
|---|---|
| Subject | Re: How to make the button disappear upon click? |
| From | "Evertjan." <exxjxw.hannivoort@inter.nl.net> |
| References | <758dd4f9-4905-4bab-91c8-f91e16c50c80@googlegroups.com> <attribute-values-20170425204220@ram.dialup.fu-berlin.de> |
| Date | 2017-04-25 22:05 +0200 |
| Message-ID | <XnsA762E0CDD7580eejj99@194.109.6.166> (permalink) |
ram@zedat.fu-berlin.de (Stefan Ram) wrote on 25 Apr 2017 in
comp.lang.javascript:
> justaguy <lichunshen84@gmail.com> 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';
};
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
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