codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  getElementByid question  ikefor at 19:05 on Wednesday, June 15, 2011
 

Hi, I need help to replace the value of the textarea below with the content of the innerHTML from a div in an external html file loaded into the object tag below. I'm kinda new to javascript and have been at it for some time now, but no luck

Any ideas will be a great help. Thanks.


<html>
<head>
function getdata(data)

{
var mystr=document.getElementById("message").value;
document.getElementById("message").value=window.document.getElementById(data).innerHTML;

}

</head>

<body>
<textarea name="message" id="message"></textarea>


<div id="one">
<object id="foo" name="foo" type="text/html" data="GoodMorning.html">
</object>
</div>

</body>
</html>

..and this is the content of the external file loaded - Goodmorning.html


<div class="bg3"><strong>Good Morning</strong>3</div>
<p><a href="javascript:window.parent.getdata('gre2');" id="gre1">A smile cn opn a heart fster dan a key cn open a door..Briten d world wt ur smile.Gd Monin</a></p>

<p><a href="javascript:window.parent.getdata('gre2');" id="gre2">Plz come out!
So that sun can rise, coz its waiting 2 see ur beautiful SMILE;Gud morning!</a></p>

<p><a href="javascript:window.parent.getdata('gre3');" id="gre3">Each morning we will watch d sunrise, Whle we r wraped in each odr's arms, Gud Mornin</a></p>

</div>














CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums








Recent Forum Threads
•  Re: html form
•  Search Analytics: What? Why? How?
•  Prom Dresses
•  Prom Dresses
•  music download problem
•  Re: Lucene Revolution --Training Classes
•  bridesmaids romantic wedding
•  Prom dresses 2011
•  Strapless mother of the bride dresses


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2011