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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Comparing column of Xpath results

Status
Not open for further replies.

dapuxter

Technical User
May 16, 2007
2
US
I'm working on a script that basically takes one column out of a table, via Xpath, and I want to compare each value of that column and see if its greater than say 15. If it is, I want an alert box to pop up with a simple message. I've gotten the xpath part figured out, but I can't figure out the javascript to check each value. I think if I can get it to assign all of those values into an array, then I could do it, but I can't figure out how to do that. Anyone done something like this or have any ideas about how it could be done?
 
If you have access to the cells via an xpath, then you should be able to do something like this:

Code:
var valueInCell = parseInt([i]yourCellRefHere[/i].innerHTML, 10);
if (valueInCell > 15) alert('This message left intentionally blank');

Hope this helps,
Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top