- From: Simon Sapin <simon.sapin@exyr.org>
- Date: Sat, 09 Nov 2013 15:29:22 +0800
- To: Jirka Kosek <jirka@kosek.cz>, www-style list <www-style@w3.org>
Le 09/11/2013 15:23, Simon Sapin a écrit :
> Le 04/11/2013 20:59, Jirka Kosek a écrit :
>> For many cases Selectors would be just
>> enough, but currently they are missing key feature -- ability to
>> select attributes in a document tree. With such ability it would be
>> possible to rewrite previous rule as:
>>
>> <its:rules xmlns:its="http://www.w3.org/2005/11/its"
>> queryLanguage="css">
>> <its:translateRule selector="@title" translate="yes"/>
>> </its:rules>
>
> Could ITS specify the attribute name separately?
>
> <its:translateRule selector="*" attribute="title" translate="yes"/>
>
As to Selector API, it can be combined with Element.getAttribute() :
document.querySelector(selector).getAttribute(attribute)
Or:
Array.prototype.map(
document.querySelectorAll(selector),
function(e) { return e.getAttribute(attribute) })
--
Simon Sapin
Received on Saturday, 9 November 2013 07:29:49 UTC