JavaScript Target element with 2 classes inside a jquery not selector target element with two classes,target element with data attribute

I can't seem to get this to work, it is probably pretty simple but here we go:

This is my selector and I want to look for an element with both the selection[0] and selection[1] class but this does not look for an element that has both. As far as I can tell it only grabs the first selection class and looks for that.

$(this).not("." + selection[0], "." + selection[1]).hide();

I've tried manually inputting it like this and it works:

$(this).not(".class1.class2").hide();

I'm guessing the comma seperates the selectors and it is going wrong there. How can I achieve the same functionality though?

Answer:1

Replace comma , with + to concatenate selection[0] with dot .

$(this).not("." + selection[0] + "." + selection[1]).hide();
Answer:2

I'm using Promise Node.js library and I'd like to do the following: Execute async operation that returns a Promise. When that operation completes, return a Promise that is completed when two paralell ...

I'm using Promise Node.js library and I'd like to do the following: Execute async operation that returns a Promise. When that operation completes, return a Promise that is completed when two paralell ...

I have a big problem with this plugin: https://github.com/katzer/cordova-plugin-email-composer when i tried to send email on ios, all work well. but when i tried in Android, it did nothing.. And i ...

I have a big problem with this plugin: https://github.com/katzer/cordova-plugin-email-composer when i tried to send email on ios, all work well. but when i tried in Android, it did nothing.. And i ...

  1. cordova email composer plugin
  2. cordova email composer
  3. cordova email composer not working in android
  4. cordova email composer not working
  5. phonegap email composer example
  6. cordova-plugin-email-composer ionic
  7. cordova-plugin-email-composer not working
  8. cordova-plugin-email-composer example
  9. ionic cordova email composer
  10. cordova plugin email composer github
  11. cordova-plugin-email-composer versions
  12. cordova-plugin-email-composer npm
  13. cordova-plugin-email-composer attachment
  14. cordova-plugin-email-composer callback
  15. cordova-plugin-email-composer ionic 3
  16. cordova-plugin-email-composer permissions
  17. cordova-plugin-email-composer android example
  18. cordova-plugin-email-composer undefined
  19. cordova-plugin-email-composer 0.8.2
  20. cordova-plugin-email-composer angular

I'm making a large Meteor app and all my templates are now named "veryLongNameOfMyTemplate". I want to avoid having such long names. I tried to create my templates in packages but I have a strange ...

I'm making a large Meteor app and all my templates are now named "veryLongNameOfMyTemplate". I want to avoid having such long names. I tried to create my templates in packages but I have a strange ...

  1. create scoped package npm
  2. create scoped package
  3. command to create scoped package

This question will need to be answered in Javascript. For example, I have an array of phone numbers: var phoneNumbers = ['123-434-4455', '123-495-8475', '484-728-3456']; The phone number at index 0 ...

This question will need to be answered in Javascript. For example, I have an array of phone numbers: var phoneNumbers = ['123-434-4455', '123-495-8475', '484-728-3456']; The phone number at index 0 ...