Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Get DOM object with javascript

Status
Not open for further replies.

IPFox

IS-IT--Management
Feb 27, 2009
2
FI
Hi,

I'm creating a page which should be able to print out already selected info. So in the following code I would like to print the value of the cart-package name.

Code:
<div class="content right" id="right-content">
		<div class="end">

		
			<!-- CART -->
			<div class="cart" id="cart">
				<h3>Order</h3>
				<ul>
					<li id="cart-hardware">
						<ul>
							<li id="cart-package">
								<p class="name">[paket]</p>
								<p class="sum month">[sum]</p>
							</li>
							<li id="cart-box">
								<p class="name">[box]</p>
								<p class="sum one-time">[sum]</p>
							</li>
						</ul>

					</li>
					
				</ul>
				<br class="clr" />
			</div>
		</div>
</div>


Hopefully you can help me out.
 
Hi

Code:
alert(document.evaluate('//li[@id="cart-package"]/p[@class="name"]',document,null,XPathResult.ANY_UNORDERED_NODE_TYPE,null).singleNodeValue.innerHTML)
Or define "print out".

Feherke.
 
Surely you already know the data used to populate the right-hand column - as you would have needed it to do just that.

This being the case, why do you need to re-read the data from the right-hand column if you already have it?

Dan


Coedit Limited - Delivering standards compliant, accessible web solutions

Dan's Page [blue]@[/blue] Code Couch:
Code Couch Tech Snippets & Info:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top