nel codice di ieri c'è un errore
posto quello giusto
Codice PHP:
function formattaTesto(idTesto,stile)
{
var testo = idTesto;
var obj=document.getElementById(testo)
if (document.all)
{
obj.focus();
var sel=document.selection;
var rng=sel.createRange();
rng.colapse;
rng.text="<span class='" + stile + "'>" + rng.text + "</span>";
}
else if(obj.selectionEnd)
{
var lng=obj.textLength;
var from=obj.selectionStart;
var to=obj.selectionEnd;
obj.value=obj.value.substring(0,from)+"<span class='" + stile + "'>" + obj.value.substr(from,to) + "</span>"+obj.value.substring(to,lng)
}
else
obj.value = "<span class='" + stile + "'>" + obj.value + "</span>";
obj.focus();
}