ruggeddesign
09-28-2006, 03:59 PM
Okay, I've decided to simplify this question so that I can post it on the web.
Basically, I have retrieved a chunk of text using the innerHTML command. This is what a sample of that text would look like:
<li class="inputLabel">Delivery Type:</li><li class="inputType">dropdown</li><li class="valRoutine">3</li><li class="ofFieldset">Packaging | Delivery | Shipping</li><li class="ofSpan">0</li><li class="ifSpan">shipping</li><li class="ifValue">Shipping</li><li class="dropdownValues"><ol id="dD_deliverytype"><li>FOB Our Dock</li><li>FOB Our Dock</li><li>1 Metro Denver Delivery</li><li>1 Metro Denver Delivery</li><li>Shipping</li><li>Shipping</li></ol></li>
I know that it SHOULD be possible to access each of these <li> tags individually using the DOM - and in fact, I do just that at the beginning of my JS file - grabbing each <li>.innerHTML individually. However, for some reason I cannot use the same technique in the new function I am building later on in the page.
So basically, I have a dilemna that I am having trouble solving. I need to grab the text between the <li class="ifValue"> . . . </li> and <li class="ifSpan"> . . . </li> tags. In other words, if the code above was assigned to a variable as a string, I would need to retrieve the values of:
var ifValue = Shipping;
var ifSpan = shipping;
Is there some way that I can splice these values out of the text string?
Basically, I have retrieved a chunk of text using the innerHTML command. This is what a sample of that text would look like:
<li class="inputLabel">Delivery Type:</li><li class="inputType">dropdown</li><li class="valRoutine">3</li><li class="ofFieldset">Packaging | Delivery | Shipping</li><li class="ofSpan">0</li><li class="ifSpan">shipping</li><li class="ifValue">Shipping</li><li class="dropdownValues"><ol id="dD_deliverytype"><li>FOB Our Dock</li><li>FOB Our Dock</li><li>1 Metro Denver Delivery</li><li>1 Metro Denver Delivery</li><li>Shipping</li><li>Shipping</li></ol></li>
I know that it SHOULD be possible to access each of these <li> tags individually using the DOM - and in fact, I do just that at the beginning of my JS file - grabbing each <li>.innerHTML individually. However, for some reason I cannot use the same technique in the new function I am building later on in the page.
So basically, I have a dilemna that I am having trouble solving. I need to grab the text between the <li class="ifValue"> . . . </li> and <li class="ifSpan"> . . . </li> tags. In other words, if the code above was assigned to a variable as a string, I would need to retrieve the values of:
var ifValue = Shipping;
var ifSpan = shipping;
Is there some way that I can splice these values out of the text string?