[thelist] need js function to toggle uppercase lowercase of selection

Stuart Young syoung at unitec.ac.nz
Mon Jul 19 21:01:05 CDT 2004

I have a browser-based text editor (contenteditable), and would like
enable a keyboard shortcut to toggle the current selection's text to
upper/lowercase. Any suggestions?

function upperMe() {
	document.converter.output.value =

function lowerMe() {
	document.converter.output.value =

This function transforms text into UPPERCASE or lowercase:<br>
<FORM NAME="converter">
<b>Input text:</b> <INPUT TYPE="text" NAME="input" VALUE="type text
<b>Ouput text:</b> <INPUT TYPE="text" NAME="output" VALUE=" "><BR><BR>
<INPUT TYPE="button" VALUE="UPPERCASE please" onClick="upperMe()"><BR>
<INPUT TYPE="button" VALUE="lowercase please" onClick="lowerMe()">

Dr Stuart Young,       +64 (0)9-815 4321 Ex 8656
<syoung at unitec.ac.nz>     
Lecturer, School of Computing and Information Technology,
Unitec New Zealand, Auckland, New Zealand
I would provide a URL for my official staffpage, but its too long and

More information about the thelist mailing list