[Solved] How can I check whether an HTML attribute is true or false?


You can use the jQuery Attribute Equals Selector [name=”value”] to do this work.

$(".col-md-4 .entry-footer [template-include="true"]").css("color", "red");
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div id="divtemp-sc" class="container-fluid tab-pane active tab-padding" role="tabpanel" aria-labelledby="divtemp-sc">
  <div class="col-md-4">
    <div class="popup-temp-entry">
      <div class="entry-header">Title 1</div>
      <div class="entry-body">Description 1</div>
      <div class="entry-footer"><a href="#" class="entry-footer-include-btn" template-include="false">Include</a></div>
    </div>
  </div>
  <div class="col-md-4">
    <div class="popup-temp-entry">
      <div class="entry-header">Title 2</div>
      <div class="entry-body">Description 2</div>
      <div class="entry-footer"><a href="#" class="entry-footer-include-btn" template-include="true">Include</a></div>
    </div>
  </div>
  <div class="col-md-4">
    <div class="popup-temp-entry">
      <div class="entry-header">Title 3</div>
      <div class="entry-body">Description 3</div>
      <div class="entry-footer"><a href="#" class="entry-footer-include-btn" template-include="false">Include</a></div>
    </div>
  </div>

</div>

2

solved How can I check whether an HTML attribute is true or false?