QueryPath Value of Element

Posted on 2012-08-24
Medium Priority
Last Modified: 2012-08-29
I'm trying to extract the value of an <li> tag like so:

  <li class="pagenumber ">1</li>

In this case the value is 1. Any ideas?
Question by:kjenney
  • 2
LVL 58

Expert Comment

ID: 38329662
Extract it to post in a form submission?
You will need to use js to get the value and append the querystring.
But this vaue would be known at page load so you could just place it in a hidden field in the form.

Explain more...

Accepted Solution

kjenney earned 0 total points
ID: 38329699
This question is related to QueryPath so I was expecting a QueryPath statement as a solution.

I figured it out:

$pagenumber = circqp->branch()->find('li[class="pagenumber"]')->text();                          
echo $pagenumber."<br>";

Open in new window


Author Closing Comment

ID: 38344686
This question is related to QueryPath so I was expecting a QueryPath statement as a solution.

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses
Course of the Month17 days, 3 hours left to enroll

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question