Tag: selector

56 votes
1 answers
1.5K views
How to use an XPath or CSS selector to look for a substring in Nightwatch testing

I'm having to do Nightwatch testing on the following element: <textarea id="xxxxxxxx-971-condition"

avatar
Georgie
0 1 0 9
asked 07 September, 2021
57 votes
2 answers
1.1K views
How to select an element&apos;s great-grandchild for CSS rules?

Given this HTML, how can I select rt-block to alter the CSS only when nested within rt-header as shown? <

avatar
Cortez
0 1 0 9
asked 07 September, 2021
55 votes
23 answers
2.9K views
@selector() in Swift?

I'm trying to create an NSTimer in Swift but I'm having some trouble. NSTimer(timeInterval: 1, targ

avatar
Majorie
0 1 0 9
asked 07 September, 2021
50 votes
20 answers
1.1K views
CSS selector for first element with class

I have a bunch of elements with a class name red, but I can't seem to select the first element with the c

avatar
Janella
0 1 0 9
asked 07 September, 2021
50 votes
10 answers
2.2K views
Which characters are valid in CSS class names/selectors?

What characters/symbols are allowed within the CSS class selectors? I know that the following characters are i

avatar
Scot
0 1 0 9
asked 07 September, 2021
67 votes
23 answers
713 views
Is there a "previous sibling" selector?

The plus sign (+) is for selecting the next sibling. Is there an equivalent for the previous sibling?

avatar
Solomon
0 1 0 9
asked 07 September, 2021
64 votes
30 answers
2K views
Is there a CSS parent selector?

How do I select the <li> element that is a direct parent of the anchor element? As an example, my CSS w

avatar
Clarice
0 1 0 9
asked 07 September, 2021
58 votes
22 answers
1.2K views
jQuery get specific option tag text

All right, say I have this: <select id='list'> <option value='1'>Option A

avatar
Elicia
0 1 0 9
asked 07 September, 2021
52 votes
14 answers
3K views
How can I select an element by name with jQuery?

I have a table column I’m trying to expand and hide. jQuery seems to hide the <td> elements when I sel

avatar
Vi
0 1 0 9
asked 07 September, 2021
64 votes
19 answers
1.2K views
How can I get the ID of an element using jQuery?

<div id="test"></div> <script> $(document).ready(function() { alert($('#test&apos

avatar
Charis
0 1 0 9
asked 07 September, 2021
52 votes
14 answers
3K views
How can I select an element with multiple classes in jQuery?

I want to select all the elements that have the two classes a and b. <element class="a b"> So, only t

avatar
Virgil
0 1 0 9
asked 07 September, 2021
58 votes
19 answers
1.7K views
How to get the children of the $(this) selector?

I have a layout similar to this: <div id="..."><img src="..."></div> and would like to us

avatar
Adolfo
0 1 0 9
asked 07 September, 2021
63 votes
30 answers
1.5K views
Get selected text from a drop-down list (select box) using jQuery

How can I get the selected text (not the selected value) from a drop-down list in jQuery?

avatar
Wilfredo
0 1 0 9
asked 07 September, 2021
58 votes
30 answers
1.4K views
How can I know which radio button is selected via jQuery?

I have two radio buttons and want to post the value of the selected one. How can I get the value with jQuery?

avatar
Luis
0 1 0 9
asked 07 September, 2021