-1

I'm looking at the following code:

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

What does the * component of the selector do?

BoltClock
  • 700,868
  • 160
  • 1,392
  • 1,356
Ole
  • 41,793
  • 59
  • 191
  • 359
  • https://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_selectors – Teemu Sep 06 '16 at 04:32
  • 2
    @Teemu: Ha, I *knew* someone would paste the wrong link first. Happens every time. No, it's not a universal selector. Read the question. – BoltClock Sep 06 '16 at 04:32
  • @Teemu: It's all good ;) I just find it funny how this keeps happening every time. – BoltClock Sep 06 '16 at 04:34
  • @BoltClock Yep, it's not an universal selector, the link is fixed now ; ). I'll bookmark the good dup for the next time. – Teemu Sep 06 '16 at 04:36

1 Answers1

2

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

guest271314
  • 1
  • 15
  • 104
  • 177