Skip to content

Commit

Permalink
a few more selector examples
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Jan 10, 2015
1 parent 1e45509 commit 00805dc
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/Mojo/DOM/CSS.pm
Expand Up @@ -347,6 +347,7 @@ An C<E> element with a C<foo> attribute.
An C<E> element whose C<foo> attribute value is exactly equal to C<bar>.
my $case_sensitive = $css->select('input[type="hidden"]');
my $case_sensitive = $css->select('input[type=hidden]');
=head2 E[foo="bar" i]
Expand All @@ -355,6 +356,8 @@ An C<E> element whose C<foo> attribute value is exactly equal to any
EXPERIMENTAL and might change without warning!
my $case_insensitive = $css->select('input[type="hidden" i]');
my $case_insensitive = $css->select('input[type=hidden i]');
my $case_insensitive = $css->select('input[class~="foo" i]');
This selector is part of
L<Selectors Level 4|http://dev.w3.org/csswg/selectors-4>, which is still a
Expand All @@ -366,26 +369,30 @@ An C<E> element whose C<foo> attribute value is a list of
whitespace-separated values, one of which is exactly equal to C<bar>.
my $foo = $css->select('input[class~="foo"]');
my $foo = $css->select('input[class~=foo]');
=head2 E[foo^="bar"]
An C<E> element whose C<foo> attribute value begins exactly with the string
C<bar>.
my $begins_with = $css->select('input[name^="f"]');
my $begins_with = $css->select('input[name^=f]');
=head2 E[foo$="bar"]
An C<E> element whose C<foo> attribute value ends exactly with the string
C<bar>.
my $ends_with = $css->select('input[name$="o"]');
my $ends_with = $css->select('input[name$=o]');
=head2 E[foo*="bar"]
An C<E> element whose C<foo> attribute value contains the substring C<bar>.
my $contains = $css->select('input[name*="fo"]');
my $contains = $css->select('input[name*=fo]');
=head2 E:root
Expand Down

0 comments on commit 00805dc

Please sign in to comment.