iOS8 Safari after a pushState the :nth-child() selectors not works

Indeed nth-child doesn’t work on IOS8. Switching for nth-of-type did the trick for me. It’s well supported https://developer.mozilla.org/en-US/docs/Web/CSS/:nth-of-type That said if you want to take no chance, you can detect IOS 8 as follow. function isIOS8() { if (“600.1.4” == $.browser.version || ~navigator.userAgent.indexOf(‘OS 8_’) ){ return true; } return false; } var i=0, $el = … Read more

How to select first row of the first table in an html page using jQuery?

$(“table:first > tr:first”) or $(“table:first”).find(“tr:first”) or $(“table:first”).children(“tr:first”) or $(“table”).eq(0).children(“tr”).eq(0) So if I understand the followup question… $(“table:eq(1) tr:has(table:eq(2))”) translates to: get any tr’s in the 2nd table’s if the tr has a 3rd table or $(“table”).eq(1).children(“tr:has(table:eq(2))”)

How to select classes with spaces

As Zepplock says, that’s actually two classes in a single attribute: boolean and optional. The space is not part of a class name; it acts as the separator. These three selectors will all match it: .boolean .optional .boolean.optional The last selector only picks up this element as it has both classes. You never include a … Read more

How to select all elements whose ID starts and ends with specific strings?

The following CSS3 selector will do the job: tr[id^=”section_”][id$=”_dummy”] { height: 200px; } The ^ denotes what the id should begin with. The $ denotes what the id should end with. id itself can be replaced with another attribute, such as href, when applied to (for example) <a>: a[href^=”http://www.example.com/product_”][href$=”/about”] { background-color: red; }

Can I use an attribute selector for CONTAINS in queryselector()?

All CSS selectors are documented on MDN and specified in the W3C CSSWG Selectors Level 4 overview1 (Archived link). The one you need is #utility-menu a[href*=”lang=”] Pattern Represents E[foo*=”bar”] An E element whose foo attribute value contains the substring bar. 1: The CSSWG’s current work of the CSS Selectors Module is Selectors Level 4. Not … Read more

Is there a jQuery-like CSS/HTML selector that can be used in C#?

Update 10/18/2012 CsQuery is now in release 1.3. The latest release incorporates a C# port of the validator.nu HTML5 parser. As a result CsQuery will now produce a DOM that uses the HTML5 spec for invalid markup handling and is completely standards compliant. Original Answer Old question but new answer. I’ve recently released version 1.1 … Read more