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


Groups > comp.lang.javascript > #33121

Re: How to make the button disappear upon click?

From Thomas 'PointedEars' Lahn <PointedEars@web.de>
Newsgroups comp.lang.javascript
Subject Re: How to make the button disappear upon click?
Date 2017-04-26 03:33 +0200
Organization PointedEars Software (PES)
Message-ID <3984715.fXfLaG00ZD@PointedEars.de> (permalink)
References <758dd4f9-4905-4bab-91c8-f91e16c50c80@googlegroups.com> <attribute-values-20170425204220@ram.dialup.fu-berlin.de>

Show all headers | View raw


Stefan Ram wrote:

> 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«).

When will you learn to cite properly?

,-<https://w3c.github.io/html/>
| 
| […]
| Publication as a Editors Draft does not imply endorsement by the W3C 
| Membership. This is a draft document and may be updated, replaced or 
| obsoleted by other documents at any time. It is inappropriate to cite
| this document as other than work in progress.

The latest version of HTML5 is the HTML 5.1 Recommendation:

<https://www.w3.org/TR/2016/REC-html51-20161101/introduction.html#a-quick-introduction-to-html>
 
>   (There might be other errors in this code, but I would like
>   to restrict my report to one error only.)

<http://validator.w3.org/nu/> exists.

Of course, to let the button disappear that was clicked, one only needs

  <… onclick="this.style.display = 'none'" …>

In maintainable code, one would probably add a class name instead and let 
the stylesheet specify the formatting:

  <… onclick="this.classList.add('hidden')" …>

-- 
PointedEars
FAQ: <http://PointedEars.de/faq> | <http://PointedEars.de/es-matrix>
<https://github.com/PointedEars> | <http://PointedEars.de/wsvn/>
Twitter: @PointedEars2 | Please do not cc me./Bitte keine Kopien per E-Mail.

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


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