Sunday, November 21, 2010

How do I add one of those html bars that allow a user to bold text, or italicize it, using a button?

I want to create a field on my website where another author (who knows no html) can simply fill in their article and bold/italicize or otherwise format their work?



I see those bars all the time. For example, at the top of an email message body, or in a WYSIWYG editor somewhere.How do I add one of those html bars that allow a user to bold text, or italicize it, using a button?
Change the text to italics:

var t = document.getElementById('text');

t.style.fontStyle = ';italic';;



Change to bold:

var t = document.getElementById('text');

t.style.fontWeight = ';bold';;

No comments:

Post a Comment