JSFiddle - React, Tailwind, and code Playground

by ChrisStanyon

HTML

<div class="pharos-1">This is a div</div>
<input type="text" class="pharos-2">
<input type="checkbox" class="pharos-3">
<input type="subit" class="pharos-4" value="Go">
<button type="button" class="other-class pharos-5">Click Me</button>
<button type="button" class="other-class abc-pharos-5">Click Me</button>

JavaScript

$( '[class*="pharos-"]' ).each(function() {
    if ( $(this).hasClass('[class^="pharos"]') ) {
    console.log("Match");
        $( this ).attr("disabled", true);
    }
});