You should not do this since all attribute based selectors are much slower than class or ID based ones.
We do something similar, but use "qa" prefixed classes instead. Kind regards Micha Rich Crook <[email protected]> schrieb am Do., 16. Juni 2016, 17:58: > Hi Marcin, > > Ok an example is better, given: > > <form> > <select data-qa="artist"> > <option value="1">Ima Robot</option> > <option value="2">Edward Sharpe and the Magnetic Zeros</option> > <option value="3">Alexander</option> > </select> > </form> > > We select options with... > > $("form").attr('[data-qa="artist"]') = "1" > $("form").attr('[data-qa="artist"]') = 2 > $("form").attr('[data-qa="artist"]') = "Alexander" > > Right? > > Thanks, > Rich > > On Wednesday, June 15, 2016 at 11:37:09 PM UTC-7, Marcin Erdmann wrote: > >> Rich, can you please explain what you mean by using data-* attributes >> directly? Are you asking how to access them? If that's the question then >> you can use something like $("element selector").attr("data-name"). >> >> On Thursday, 16 June 2016, Rich Crook <[email protected]> wrote: >> >>> Hello, >>> >>> Is it possible to directly use the data-* attributes only without using >>> the element tag name? >>> >>> Thanks! >>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "Geb User Mailing List" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to [email protected]. >>> To post to this group, send email to [email protected]. >>> To view this discussion on the web visit >>> https://groups.google.com/d/msgid/geb-user/5bd0ee91-69d4-459f-b62d-1cf8ea8a17f6%40googlegroups.com >>> <https://groups.google.com/d/msgid/geb-user/5bd0ee91-69d4-459f-b62d-1cf8ea8a17f6%40googlegroups.com?utm_medium=email&utm_source=footer> >>> . >>> For more options, visit https://groups.google.com/d/optout. >>> >> -- > You received this message because you are subscribed to the Google Groups > "Geb User Mailing List" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/geb-user/7c5f3c36-54c6-4562-b50e-a0dbb8edc992%40googlegroups.com > <https://groups.google.com/d/msgid/geb-user/7c5f3c36-54c6-4562-b50e-a0dbb8edc992%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Geb User Mailing List" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/geb-user/CALYktxMMijd3N5tyTbNSasezELWy27%3DQiwZZ3memGgGLWQRCsg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
