Wasn't sure what to put as the title, but what is happening is this:
I have div elements on a HTML page, when they click on the div it is replaced with a textarea containing the div contents in order to edit this (eventually there will be a form/submission button there, but I need to sort this first) but the problem is that in IE it is printing all tags in uppercase, is there a problem with my code or is just just another problem in IE? (I am using IE6, I have not tested in 7 or 8)
Code:
HTML:
<h2><br>Signing Course.</h2>
<div id="event_1" onclick="edit_content(this.id)">Barrie Paddon is soon to start a group for those wishing to learn basic sign language.<br>
Barrie who has achieved level 2 in British Sign Language led a large
group last year who spectacularly sang The Lord’s Prayer in sign
language. All interested please contact the office.<br></div>
JS:
<script type="text/javascript">
function edit_content(container) {
if(document.getElementById(container).innerHTML.substr(0,5) == "<text") {
} else {
document.getElementById(container).innerHTML = "<textarea name=\"" + container + "\" rows=\"10\" cols=\"90\">" + document.getElementById(container).innerHTML + "</textarea>";
editing = '1';
}
alert(document.getElementById(container).innerHTML.substr(0,5));
}
</script>
IE outputs:
Barrie Paddon is soon to start a group for those wishing to learn basic sign language.<BR>Barrie who has achieved level 2 in British Sign Language led a large group last year who spectacularly sang The Lord’s Prayer in sign language. All interested please contact the office.<BR>
into the textbox, and the alert shows '<TEXT'
Any ideas?