aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes Need usage help for getDocumentById Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Need usage help for getDocumentById" Watch "Need usage help for getDocumentById" New topic
Author

Need usage help for getDocumentById

Raghav Sam
Ranch Hand

Joined: Apr 12, 2001
Posts: 412
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.


Be who you are and say what you feel, because those who mind don't matter and those who matter don't mind.<br />- Dr. Seuss
Niki Nono
Ranch Hand

Joined: Mar 20, 2005
Posts: 256
try this



Life called,so here I am.<br />Cheers<br />Niki.:-)
Raghav Sam
Ranch Hand

Joined: Apr 12, 2001
Posts: 412
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

Joined: Apr 12, 2001
Posts: 412
Any tutorials on getElementById?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61433
    
  67

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.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Niki Nono
Ranch Hand

Joined: Mar 20, 2005
Posts: 256
how about this

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Need usage help for getDocumentById