07-24-2023, 12:46 AM
I have the following p tag:
<p style=" color: red;">-Pepsi</p>
I would like to change the color of the text based on the text color and text value. So if text is Pepsi and color is not red than I would like to change the color to blue.
Till now i can check text value with the following code:
$('p:contains("Pepsi")').css('color', 'blue');
but I can not find how to check the color of the text at the same time.
Any suggestion please?
<p style=" color: red;">-Pepsi</p>
I would like to change the color of the text based on the text color and text value. So if text is Pepsi and color is not red than I would like to change the color to blue.
Till now i can check text value with the following code:
$('p:contains("Pepsi")').css('color', 'blue');
but I can not find how to check the color of the text at the same time.
Any suggestion please?