Set the text in a span

jquery

Solution

Use `.text()` instead, and change your selector:

$(".ui-datepicker-prev .ui-icon.ui-icon-circle-triangle-w").text('<<');

-- VIEW DEMO --

Problem

I have this span ``` <a title="Prev" data-event="click" data-handler="prev" class="ui-datepicker-prev ui-corner-all"> <span class="ui-icon ui-icon-circle-triangle-w">Prev</span> </a> ``` I need to set the text of the span to be `<<` instead of its current text `Prev`. I tried this below, but it didn't change the text as I'd expected. How can this be done? ``` $(".ui-icon .ui-icon-circle-triangle-w").html('<<'); ```

Original source

Related problems