File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Need usage help for getDocumentById

 
Raghav Sam
Ranch Hand
Posts: 412
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I have the foll code


I am able to change the text Yes to No using document.getDocumentById('TR1).children(1).innerText = 'No'

Now I want to disable/enable the checkbox in a similar fashion. Any help in this regard is appreciated.
 
Niki Nono
Ranch Hand
Posts: 256
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
try this

 
Raghav Sam
Ranch Hand
Posts: 412
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Niki Nono:
try this



Thanks, but I want to access the checkbox using the children property or assume there is no id for the checkbox
 
Raghav Sam
Ranch Hand
Posts: 412
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any tutorials on getElementById?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64175
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Doing so isn't the best of ideas. By writing your code that way you couple your script to the structure of the document. If the document structure changes, your script breaks. Assigning unique ids to the elements make your script structure-independent.

That said, sometimes you just gotta do it by inspection. Your best bet is to get a good HTML DOM reference so you can see what each element exports as properties that you can use to inspect the structure and find the element(s) that you want.
 
Niki Nono
Ranch Hand
Posts: 256
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how about this

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic