Ole Ole - 1 year ago 72
Javascript Question

What does the * do when used as part of an attribute selector?

I'm looking at the following code:

var script = document.querySelector('script[src*="' + file + '"]');

What does the
component of the selector do?

Answer Source

* at attribute selector matches file if file string is contained within the attribute

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download