justinbriggs1 Posted September 23, 2008 Share Posted September 23, 2008 Is there a way to use a variable as an argument for getElementByID?Sort of like:var contents = document.getElementById(el.name).valueel.name is my variable that references the name of a table row.Thanks,JW Link to comment Share on other sites More sharing options...
Jesdisciple Posted September 23, 2008 Share Posted September 23, 2008 Yes, what you showed above will work. For example, if el.name is element, that code will find the first element in the page with id="element". Link to comment Share on other sites More sharing options...
justinbriggs1 Posted September 23, 2008 Author Share Posted September 23, 2008 Yes, what you showed above will work. For example, if el.name is element, that code will find the first element in the page with id="element".Yep you were right, just had the code at an awkward location. Thanks! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.