Skip to main content

Questions tagged [jquery-selectors]

Selectors can be used in jQuery to match a set of elements in a document. Most CSS selectors are implemented, as well as a set of custom ones.

7 votes
6 answers
16k views

Using jQuery, how to find out if CSS selector "input[type=text]" is natively supported by browser?

In my CSS I have a rule that must be applied to all text fields (using the CSS3 selector input[type=text]. I also use jQuery. Some browsers like Internet Explorer 6 does not support that form for CSS ...
Jesper Rønn-Jensen's user avatar
0 votes
5 answers
263 views

jquery selectors problem

I have an issue using jquerys selectors when it comes to a page I am populating from a database. The database populates a which will display 4 <li> tags per row for x amount of rows. I am ...
DanC's user avatar
  • 1,307
7 votes
5 answers
3k views

jQuery :has(.something:contains()) unsupported?

Given the HTML below, I am trying to use jQuery to match all the list items that have a span with the class "foo" and that span should contain the text "relevant". <ul> <li>Some text &...
Vegard Larsen's user avatar
2 votes
4 answers
5k views

jQuery selector problem

I have this selector: $("table.details tbody tr:not(.details)") But I'm wondering why this inner table gets selected too: <table class="items details"> <thead> <tr> ...
Kordonme's user avatar
  • 2,294
19 votes
3 answers
23k views

jQuery Partial Selectors

I have a number of tables, which have nested tables. I using jQuery to hide some of the table cells as a number are empty or the contents irrelevant. I use jQuery to hide all TD's and then jQuery to ...
CLiown's user avatar
  • 13.8k
30 votes
5 answers
11k views

How to judge whether selected result is empty or not with jQuery?

$("#experiences tr") For the above one,how to judge if it's empty or not? I thought its boolean value should be false,but seems not.
omg's user avatar
  • 139k
1 vote
2 answers
428 views

How to find the first row not with all cells filled by "&nbsp" with jQuery?

<table id="experiences" cellpadding="0" border="1" width="100%"> <caption>table name</caption> <tr><th>col1</th><th>col2</th><th>col3</...
omg's user avatar
  • 139k
100 votes
4 answers
94k views

Hide all but $(this) via :not in jQuery selector

Advanced title, simple question: How can I do the following in jQuery (hiding everything except $(this))? $("table tr").click(function() { $("table tr:not(" + $(this) + ")").hide(); // $(...
Kordonme's user avatar
  • 2,294
9 votes
1 answer
35k views

using variables in rel attribute in jquery selector

I'm using the rel attribute to match a div to a button. I use the button's id in the corresponding div's rel field. There are multiple buttons. When a button is clicked I want to show the ...
user avatar
272 votes
25 answers
608k views

jQuery Set Select Index

I have an select box: <select id="selectBox"> <option value="0">Number 0</option> <option value="1">Number 1</option> <option value="2">Number 2</option&...
user avatar
17 votes
3 answers
9k views

Are jQuery's :first and :eq(0) selectors functionally equivalent?

I'm not sure whether to use :first or :eq(0) in a selector. I'm pretty sure that they'll always return the same object, but is one speedier than the other? I'm sure someone here must have ...
travis's user avatar
  • 36.2k
72 votes
6 answers
89k views

Select all elements that have a specific CSS, using jQuery

How can I select all elements that have a specific CSS property applied, using jQuery? For example: .Title { color:red; rounded:true; } .Caption { color:black; rounded:true; } How ...
ebattulga's user avatar
  • 10.9k
11 votes
4 answers
4k views

What is the difference between jQuery's space and > selectors?

What's the difference between the space and > selectors? And possibly related, how can I look for something that's the direct child of something else, and not lower down the descendant line?
Eliyahu's user avatar
  • 331
1 vote
1 answer
261 views

Select a tag nested within a ":last" selector

What is the selector syntax to select a tag after using the ":last" selector? <table> <tr> <td> Cell 1 </td> <td> <...
Jeremy's user avatar
  • 9,153
267 votes
5 answers
289k views

jQuery selector for the label of a checkbox

<input type="checkbox" name="filter" id="comedyclubs"/> <label for="comedyclubs">Comedy Clubs</label> If I have a check box with a label describing it, how can I select the label ...
Darwyn's user avatar
  • 4,776

15 30 50 per page
1
595 596
597
598 599
601