473,322 Members | 1,405 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Problem with innerText/textContent

Hai, I am new to this group. But not to Javascript.
I have a problam with innerText in FireFox.
I have the code as below.
--
var inputArea = document.getElementById("rtsText");
var outputArea = document.getElementById("uniText");
outputArea.innerText = transformInput(inputArea.value);
--
I have two elements, a textarea in which user entered RTS text, and a
div tag in which the converted Unicode text will be place using
transformInput funcion.

But my problem is, innerText is working fine in IE, but not in
FireFox. So i tried to use textContent in FireFox. It is working but
the line breaks (which will get by pressing Enter key) in the input
textare will not reflect in the output div tag. Could anybody tell me
solution.
-Thanks and Regards
-Srinivasa Raju Datla

Feb 13 '07 #1
2 9482
VK
On Feb 13, 10:35 pm, "Srinivasa" <srinivasaraju.da...@gmail.com>
wrote:
the line breaks (which will get by pressing Enter key) in the input
textare will not reflect in the output div tag.
A line break in textarea is CR, NL or CR+NL characters - depending on
OS

A visual line break in HTML is <BRtag == characters "<"+"B"+"R"+">"

Do you see a single match or a correlation between of two? I do not -
because there is not any.

This question was just asked I believe in another thread - look
around. If you want to make a HTML markup with BR tags out of text
source with physical line breaks then use regexp to replace all \n|\r|
\r\n with "<BR>" and use innerHTML - for simple cases - for insertion
over HTML parser invocation.

Feb 13 '07 #2
Srinivasa wrote:
I have two elements, a textarea in which user entered RTS text, and a
div tag in which the converted Unicode text will be place using
transformInput funcion.

But my problem is, innerText is working fine in IE, but not in
FireFox. So i tried to use textContent in FireFox. It is working but
the line breaks (which will get by pressing Enter key) in the input
textare will not reflect in the output div tag.
Use a pre element instead of the div element.
--

Martin Honnen
http://JavaScript.FAQTs.com/
Feb 14 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: scott cooper | last post by:
Can someone help me understand why this script sets only some of the div.InnerText proerties of my page. If I set the language to VBScript and remove the semicolons it works. I'm just getting...
13
by: Jeff | last post by:
Hi! I'm trying to update a number in a document with the following code. It displays a number, a div block with a minus sign and a div block with a plus sign. When I click the plus sign I want...
4
by: boxrec | last post by:
I have a prototype ajax app which works fine under IE but doesn't write out the returned data to the browser under Firefox. Are there any pitfalls bugs I should be aware of ? The prototype is here...
1
by: BLAdeMAN | last post by:
I want a .net component, that a lot of applications can share one instance of it. So i wrote the following code: 1.TextViewer.FormTextViewer(the component): using System; using...
38
by: Luke Matuszewski | last post by:
Welcome I have read the in the faq from jibbering about the generic DynWrite, but i also realized that is uses only innerHTML feature of HTML objects. (1) Is there a DOM function which is very...
4
by: conckrish | last post by:
Hai All, In my ASP.NET application, I have created a popup window using a mouseover event for Label.I have placed all popup controls inside a div tag.This popup working well in IE,but not...
20
by: effendi | last post by:
I am testting the following code in firefox function fDHTMLPopulateFields(displayValuesArray, displayOrderArray) { var i, currentElement, displayFieldID, currentChild, nDisplayValues =...
7
by: ja | last post by:
Hi, I've made an pseudo-select, wich using DOM functions like: document.createElement() appendChild() document.getElementById() with(obj){
6
by: Murray Hopkins | last post by:
Hi. THE QUESTION: How do I get a reference to my Object when processing an event handler bound to an html element ? CONTEXT: Sorry if it is a bit long. I am developing a JS calendar tool....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.