Menu
I am making an HTML Builder. I want a thing where the visitor selects some text and is then able to apply HTML formatting to it. There would be buttons like B, I, U, Center, etc. Similar to this forum. I am making a script for it right now, but it’s not working. Please help! Thanx.
<script languge=”JavaScript”>
function ChangeTxt(form) {
var txt=””;
txt+=””;
if (form.text.value) {
txt+=”<b>” + form.text.select() + “</b>”;
}
else {
txt+=””;
}
form.text.value=txt;
}
</script>
<form>
<textarea cols=”65″ rows=”10″></textarea>
<br>
<center><input type=”button” value=”Change” onClick=”ChangeTxt(this.form);”></center>
</form>