ChildNodes set IDs for <tr>
I have the following code in which i'm having some problems with:
On our website this is created by the server in asp and therefore has no ID's on the table or its rows.
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<a id="alink" href="www.google.com">Google1</a>
<a id="alink" href="www.google.com">Google2</a>
<a id="alink" href="www.google.com">Google3</a>
The problem is that we are having a problem with the css of the table without any IDs or Classes I am unable to do this.
At the end of the day I need to be able to modify the css of all the <li> in the above code.
Can anyone help with my above theory of using setAttribute() or is there possible a better way?
Originally Posted by B.vidler
var listItems = document.getElementById(
"ctl00_m_g_022cac31_8157_4fad_acd6_d841986564fc" ).getElementsByTagName( "LI" ) );
Where used, return should be executed unconditionally and always as the last statement in the function.
That's my signature, it's not part of the damn post!
Omg, after all the things i have tried today, pulling my hair out.
I had a feeling there was a way to get all the elements nested in another element but always thought you could only do document.getelementbyId.
Thanks so much!
See, for example, the HTML table object in w3schools.com. Its enough to reach the table to get all the rows and cells with the corresponding methods...
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)