link div to input text in firefox

Posted by golf_nut on Stack Overflow See other posts from Stack Overflow or by golf_nut
Published on 2011-01-07T03:42:49Z Indexed on 2011/01/07 3:53 UTC
Read the original article Hit count: 214

I'm using google maps api to have a map show up on my website where visitors can also find directions. I have a starting point setup and an end point. Both are text areas. The start is empty, but I want the end point to be populated with the address from a div that I already have in the page. I have the javascript as:

var address = document.getElementById("address").innerText.replace(/\n/g, " ");

It works in Chrome, but Firefox shows the text in the endpoint box as 'undefined.' And Firebug is giving me -

document.getElementById("address").innerText is undefined [Break On This Error] var address = document.getElementB...ress").innerText.replace(/\n/g, " ");

Any help is appreciated.

Thanks

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about firefox