How to choose a paragraph with only a specific class
Let's say I have HTML code that looks like this:
<p class="p">Paragraph</p> <p class="p p2">Paragraph 2</p> <p class="p p3">Paragraph 3</p> If I use: $('.p').css('color','red') , this will apply red color to all paragraphs.
How to apply a style to a paragraph that only has the class p , which is the first paragraph in this case?
+6
user2329398
source share