JavaScript JQuery .find() can find by id, but not by class jquery find find child,jquery find find,jquery find after

I've created the following DOM using Jquery:

<div id="d0" class="choiceDiv">
    <input type="checkbox" id="cb0" class=".userCheckBox" value="Option 1" checked="checked">
    <input type="hidden" id="h0" class=".userCheckBoxHidden" value="true">
    <label for="cb0">Option 1</label>
</div>

I've applied CSS tags to my elements in the DOM, through the CSS classes do not have any properties inside of them at this point.

There are about 17 of these in a div. After the page has been loaded, I'd like to reload the current checked value of each checkbox. As I iterate through each code, I try to use the .find() function on the DOM:

$('.choiceDiv').each(function(e){

When I try to find by Class,

$(this).find('.userCheckBox');

I get the following failure Object:

init [prevObject: init(1), context: div#d0.choiceDiv, selector: ".userCheckBox"]
context: div#d0.choiceDiv
length: 0
prevObject:init [div#d0.choiceDiv, context: div#d0.choiceDiv]
selector:".userCheckBox"
__proto__:Object(0)

When I try to find by ID,

$(this).find('#cb'+e)[0];

I get what I'm looking for:

<input type="checkbox" id="cb0" class=".userCheckBox" value="Option 1" checked="checked">

I was hoping to pull the object by class to ensure I always get the type of input I'm looking for. Can someone explain why I can use .find() with an ID and not by Class in this instance? I tried figuring it out with this post but couldn't get it to work.

Answer:1

I want to call my ajax function untill already run ajax not give a response Page is load on every sec and every sec ajax function call but i want to call ajax untill already run ajax function is not ...

I want to call my ajax function untill already run ajax not give a response Page is load on every sec and every sec ajax function call but i want to call ajax untill already run ajax function is not ...

  1. call ajax function from html
  2. call ajax function on button click
  3. call ajax function on page load
  4. call ajax function from javascript
  5. call ajax function every 5 seconds
  6. call ajax function on press enter key
  7. call ajax function onclick
  8. call ajax function from php
  9. call ajax function in jquery
  10. call ajax function after page load
  11. call ajax function on link click
  12. call ajax function on select change
  13. call ajax function on anchor click
  14. call ajax function in wordpress
  15. call ajax function from code behind c#
  16. call ajax function on button click in asp.net
  17. call ajax function multiple times
  18. call ajax function on form submit
  19. call ajax function on dropdown change
  20. call ajax function from another ajax function

I have a problem on how to rearrange my panels on mobile. The panels have different sizes. Pls see attach for the screenshot of the page in large screen (col-lg): EDIT: The large screen layout is ok, ...

I have a problem on how to rearrange my panels on mobile. The panels have different sizes. Pls see attach for the screenshot of the page in large screen (col-lg): EDIT: The large screen layout is ok, ...

I'm writing a NodeJS service that requests data from APIs. Under load, I don't want to hammer the API with potentially hundreds of simultaneous requests, so I am trying to queue up the requests so ...

I'm writing a NodeJS service that requests data from APIs. Under load, I don't want to hammer the API with potentially hundreds of simultaneous requests, so I am trying to queue up the requests so ...

I'm learning electron and I've made an electron app that read and create files. When I start the application with "npm start" or "electron ." it works as intended but when I use the "npm run build" ...

I'm learning electron and I've made an electron app that read and create files. When I start the application with "npm start" or "electron ." it works as intended but when I use the "npm run build" ...