Uncaught DOMException: Failed to execute 'querySelectorAll' on 'Document': 'tr:contains("2018-01-22")' is not a valid selector

I am trying to apply css via DOM lib. My code is :

$$('tr:contains("2018-01-22")').css('font-weight', '600').css('color', '#f00');

on console I get following error :

framework7.js:674 Uncaught DOMException: Failed to execute 'querySelectorAll' on 'Document': 'tr:contains("2018-01-22")' is not a valid selector.
at t (http://localhost/app/framework7/js/framework7.min.js:12:868)
at eval (eval at <anonymous> (http://localhost/app/js/my-app.js:54:7), <anonymous>:77:5)
at HTMLScriptElement.<anonymous> (http://localhost/app/js/my-app.js:54:7)
at V.each (http://localhost/app/framework7/js/framework7.min.js:12:45989)
at HTMLDocument.<anonymous> (http://localhost/app/js/my-app.js:48:38)
at HTMLDocument.a (http://localhost/app/framework7/js/framework7.min.js:12:41556)
at V.trigger (http://localhost/app/framework7/js/framework7.min.js:12:43619)
at i.pageCallback (http://localhost/app/framework7/js/framework7.min.js:12:102518)
at i (http://localhost/app/framework7/js/framework7.min.js:12:9768)
at http://localhost/app/framework7/js/framework7.min.js:12:14676 

The same selector works with jquery, but not with Dom7.

Such hack not supported by Dom7

Can you please suggest workaround. Otherwise I have to use jquery for this simple task.

As a workaround you need to loop through tr and checking its content

1 Like