• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Passing Value from Javascript method into HTML Body

 
Raihan Jamal
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 65335
97
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
innerHTML
 
Raihan Jamal
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You CAN NOT use document.write after the page loads.

Eric
 
Raihan Jamal
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 65335
97
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why not try to figure out why innerHTML was "not working"?
 
Raihan Jamal
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I tried it already.. But nothing was happening when I tried to replace the label ID with innerHTML...
 
Paul Clapham
Sheriff
Posts: 21554
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Eric Pascarello wrote:You CAN NOT use document.write after the page loads.

Eric
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic