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


Groups > comp.lang.javascript > #35981

Re: selector for queryselectorAll

Subject Re: selector for queryselectorAll
Newsgroups comp.lang.javascript
References <2cqdnQ8FY_kIRMXBnZ2dnUU7-WfNnZ2d@westnet.com.au> <9234b072-8719-2097-0622-3a79a12373ab@PointedEars.de> <R_2dnY6gkvV1usTBnZ2dnUU7-f3NnZ2d@westnet.com.au> <7deb7e30-533b-53c5-06a0-eea04a3b7348@PointedEars.de>
From Andrew Poulos <ap_prog@hotmail.com>
Date 2019-02-06 07:36 +1100
Message-ID <OIydndXf0uIsbsTBnZ2dnUU7-R_NnZ2d@westnet.com.au> (permalink)

Show all headers | View raw


On 6/02/2019 2:51 am, Thomas 'PointedEars' Lahn wrote:

> Again, you SHOULD use the “class” attribute value as a hook for applying an
> "action", NOT “data-” attributes; that is not what they are for.  In the
> class attribute, it is a good idea and recommended practice to distinguish
> class names that merely serve as scripting hooks by using a prefix, e.g. “js-”.

The data attributes already exist to store custom data so I would be 
adding classes just for the hooks. Is that a good idea?

> <https://cssguidelin.es/#javascript-hooks>

Oh man, it would've been good to have seen that before I started

>> Anyhow, thanks for the feedback it's made me realise that I could/should
>> create an array of data attributes and create a selector(s) from that.
>           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> You’re welcome, but what do you mean by that?

I'm going to maintain a list of attributes and create selectors from the 
list.

Andrew Poulos

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


Thread

selector for queryselectorAll Andrew Poulos <ap_prog@hotmail.com> - 2019-02-05 11:32 +1100
  Re: selector for queryselectorAll Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2019-02-05 03:26 +0100
    Re: selector for queryselectorAll Andrew Poulos <ap_prog@hotmail.com> - 2019-02-05 17:06 +1100
      Re: selector for queryselectorAll Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2019-02-05 16:51 +0100
        Re: selector for queryselectorAll Andrew Poulos <ap_prog@hotmail.com> - 2019-02-06 07:36 +1100
  Re: selector for queryselectorAll Mickey Finn <mfinney@gmail.com> - 2019-02-09 15:12 -0200

csiph-web