BreadCrumbs: JavaScript

JavaScript

From Luke Jackson

(Difference between revisions)
Jump to: navigation, search
Revision as of 04:27, 27 October 2016 (edit)
Ljackson (Talk | contribs)
(XPath)
← Previous diff
Revision as of 18:14, 17 June 2018 (edit)
Ljackson (Talk | contribs)
(XPath)
Next diff →
Line 5: Line 5:
//td[8] //td[8]
//option/@value | //select/@id | //input/@id | //select/optgroup/@label | //option/text() //option/@value | //select/@id | //input/@id | //select/optgroup/@label | //option/text()
 +
 +=== Chrome Xpath ===
 +
 +Open developer tools to access the console and use the xpath function call to iterate the array of option items for the select object. Log them to the console using a for each function loop.
 +
 + $x('//*[@id="miles"]/option/text()').forEach(function(el){console.log(el)});

Revision as of 18:14, 17 June 2018

XPath

count(//td[text() ="Men's XL"])
//td[text() ="Men's XL"]
//td[8]
//option/@value | //select/@id | //input/@id | //select/optgroup/@label | //option/text()

Chrome Xpath

Open developer tools to access the console and use the xpath function call to iterate the array of option items for the select object. Log them to the console using a for each function loop.

$x('//*[@id="miles"]/option/text()').forEach(function(el){console.log(el)});
Personal tools