title: Hide element based on attribute value
body: <p>I have a button I'm using to toggle between displaying yes/no 'in-policy' divs</p>
  
  <pre><code>&lt;form&gt;
  &lt;input type="radio" id="Policy0" name="Policy" value="0" onclick="filterHotel();"&gt;&lt;label for="Policy0"&gt;All&lt;/label&gt;
  &lt;/form&gt;
  &lt;script type="application/javascript"&gt;
  var Policy = $('input:radio[name=Policy]:checked').val()
  if (Policy == 0) {  
   $('form [data-policy="0"]').toggle();              
  }
  &lt;/script&gt;
  
  &lt;div id="24448" data-policy="0"&gt;Data here&lt;/div&gt;
  &lt;div id="24448" data-policy="1"&gt;Data here&lt;/div&gt;
  </code></pre>
  
  <p>With the code above I can successfully show/hide the correct div, but my issue is I don't want to wrap my input in a form element. Is there a way to reference based on a value in an attribute?</p>
  
  <p>I've tried <code>$('input[attr=data-policy][value="0"]').toggle();</code> but that doesn't seem to work. I'm sure I'm missing something simple, can someone point me in the right direction?</p>
  
  <p>EDIT: <code>$('input[data-policy="0"]').toggle();</code> does not work, i don't get an error, but it doesn't hide a div with an attribute of <code>data=policy="0"</code> I also tried <code>data-policy=0</code> with no luck</p>