aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes Passing Value from Javascript method into HTML Body Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Passing Value from Javascript method into HTML Body" Watch "Passing Value from Javascript method into HTML Body" New topic
Author

Passing Value from Javascript method into HTML Body

Raihan Jamal
Ranch Hand

Joined: Mar 23, 2010
Posts: 86
How can I pass value from Javascript method into my table that is there in HTML Body tag.. Suppose
following lines are written under script in Javascript...




and I want to dislpay the value of caption in a table which is there in HTML Body, like this


How can I do this.. Any help will be aprreciated...!!
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61224
    
  66

innerHTML


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Raihan Jamal
Ranch Hand

Joined: Mar 23, 2010
Posts: 86
Thanks for replying...
I tried using innerHTML but I am not getting the value....I think innerHTML is not working in my code....
this is my code where I am using innerHTML in script:-




And in my body section where I have to put the value that is replaced by innerHTML is:


Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
You CAN NOT use document.write after the page loads.

Eric
Raihan Jamal
Ranch Hand

Joined: Mar 23, 2010
Posts: 86
I didn't get you... So what should I do.. i tried that by using innerHTML but no luck...!!!
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61224
    
  66

Why not try to figure out why innerHTML was "not working"?
Raihan Jamal
Ranch Hand

Joined: Mar 23, 2010
Posts: 86
I tried it already.. But nothing was happening when I tried to replace the label ID with innerHTML...
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18570
    
    8

If you want us to discuss your problems with using innerHTML, perhaps it might help if we could see the code which you say "nothing was happening"?
Raihan Jamal
Ranch Hand

Joined: Mar 23, 2010
Posts: 86
You can see the code in my previous post... I have posted my whole code...
In the script I am using innerHTML to replace the ID of Label used in HTML Body tag....
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Eric Pascarello wrote:You CAN NOT use document.write after the page loads.

Eric
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Passing Value from Javascript method into HTML Body