In my DOM element, if my CSS class starts with a specific element ,i would like to do a jquery action. for example:
Say, my DOM element looks like below.
<body>
<div id="mydiv">
<h1>This is a heading</h1>
<p class="introduce">This is a paragraph.</p>
<p class="introduction">This is another paragraph.</p>
</div>
</body>
I would like to do the action if my class name wild card(ex: intro) exists.
If wildcard classname "intro" exists //i need the Jquery syntax for this condition
{
$(".introduce").css({ 'color': '#288054' })
$(".introduction").css({ 'color': '#fjhdhd' })
}
how to achieve this using jquery?
I can do same action for all classes that starts with or ends with specific TEXT using CSS. but here, i have to do different action in each class matching the wildcard
edited: i should have added this earlier. i would like to do this in jquery as i want to convert the css to inline styles. because these contents are going to be delivered in email. as outlook support inline styles better, we would like to use jquery. any other alternatives are also appreciated.