Check if inputs have specific value

Check if inputs have specific value

I've been scratching my head and either got it completely wrong or close...

I have div that displays and number e.g. 106

I then want to run a query that will take that ID and check if any inputs values on the same page has that number. 

If one does have that value, then the input gets ticked.

However all I get is undefined.....

  1. var dev_id = jQuery('.dev_title').text();
  2. alert(dev_id);
  3. if (jQuery(".dev_id").val() === dev_id) {
  4.     jQuery(this).prop('checked', true);
  5.     alert(dev_id);

  1. <span class="dev_title">106</span>

    1. <div class="dropdown">
    2. <label>
    3. <input type="checkbox" class="dev_id" value="92"> Brewary A
    4. </label>
    5. <label>
    6. <input type="checkbox" class="dev_id" value="106"> Brewary B
    7. </label>
    8. <label>
    9. <input type="checkbox" class="dev_id" value="392"> Brewary C
    10. </label>
    11. </div>