SHERIN AS SHERIN AS - 1 year ago 90
jQuery Question

How to show particular div using jQuery

<div class="companyname" data-companyname="abc" ></div>
<div class="companyname" data-companyname="xyz" ></div>
<div class="companyname" data-companyname="pqr" ></div>

I need show only data-companyname="abc" div i used following way in jQuery


How to get this?

Answer Source

.companyname {
  display: none
<script src=""></script>
<div class="companyname" data-companyname="abc">1</div>
<div class="companyname" data-companyname="xyz">2</div>
<div class="companyname" data-companyname="pqr">3</div>

use the attr selector

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download