We help IT Professionals succeed at work.

<span>Are you also the instructor for this course?</span>

Tom Knowlton
Tom Knowlton asked
on
<span>Are you also the instructor for this course?</span>


I want to add css to this span, but I don't know how to specify the internal text to look for.

$('span ???').css("margin-top","20px");

Maybe:

$('span :contains ???').css("margin-top","20px");



I guess there is no reason why I could not give the span an ID in the original markup....

Comment
Watch Question

try this
$("span:contains(Are you also the instructor for this course?)").css("margin-top","20px");

please refer to this article
http://richard2001.blogspot.com/2010/02/select-elements-by-innerhtml-with.html
Tom KnowltonWeb developer

Author

Commented:
thx!