ciao a tutti,
sto smanettando un po' con javascript ed ecco quello che vorrei fare: dato il codice seguente, è possibile formattare del testo con dei marcatori semplicemente selezionandolo nella textarea anzichè utillizzare il prompt come da esempio?
Grazie a tutti per le eventuali risposte!!
---
<head>
<title></title>
<script type="text/javascript">
function aggiungi_marcatore(tag)
{
testodaformattare=prompt('Inserire testo da formattare <'+tag+'> e </'+tag+'>:');
testo="<"+tag+">"+testodaformattare+"</"+tag+">";
document.modulo.area.value+=testo;
}
</script>
</head>
<body>
<form name="modulo">
<textarea name="area" cols="15" rows="5"></textarea>
<input type="button" name="Button" value="B" onClick="aggiungi_marcatore('B')">
</form>
</body>