How would i be able to select a word and change the colour of that one word?
e.g. add a span with style and chage the font colour.
Can someone lead me down the right path please.
Jquery
function edit_addon (div_id) {
$("#"+div_id).attr ('contentEditable', true)
.css ('color','#F00')
.css ('cursor','Text')
;
}
HTML
<div id="34" ondblclick="javascript:edit_addon(34)">Editable Text</div>
Thank you,
The easiest way would be to dynamically add spans with the individual in the div and just change the color of the current span. Here’s the basic idea: