2
<script type="text/javascript" charset="utf-8" src="http://static.polldaddy.com/p/5968383.js"></script>
<noscript>
    <a href="http://polldaddy.com/poll/5968383/">
        This is a test question ?
    </a>
</noscript>

The css class which styles the text "This is a test question" is "pds-question-top". Is it possible to style part of this text, ie change the colour of "This" to blue ?

Here it is on jsfiddle : http://jsfiddle.net/25LjE/

Felix Kling
  • 795,719
  • 175
  • 1,089
  • 1,143
user701254
  • 3,935
  • 7
  • 42
  • 53

2 Answers2

1

If you have a div like this:

<div class="pds-question-top"> This is a test question ?</div>

you can replace the text with a new text where 'This' is inside a span.

var rp = $('.pds-question-top').text().replace('This', '<span style="color:blue;">This</span>');

$('.pds-question-top').html(rp);

Is not a nice solution but it should be work.

Alex Ball
  • 4,404
  • 2
  • 17
  • 23
0

Although a JavaScript solution would be nice, see Alex' answer, your text in question is within a noscript tag, meaning any attempts to resolve this with JavaScript won't work.

Alternatively I would recommend wrapping said text in a span element, manually, and then styling that with a class, like so:

Html

<script type="text/javascript" charset="utf-8" src="http://static.polldaddy.com/p/5968383.js"></script>
<noscript>
    <a href="http://polldaddy.com/poll/5968383/">
        <span class="highlight">This</span> is a test question ?
    </a>
</noscript>

Css

.highlight
{
    color: #0f0;
}
Richard
  • 8,110
  • 3
  • 36
  • 59