diff --git a/lib/webrat/selenium/location_strategy_javascript/label.js b/lib/webrat/selenium/location_strategy_javascript/label.js index dd137441..52111e30 100644 --- a/lib/webrat/selenium/location_strategy_javascript/label.js +++ b/lib/webrat/selenium/location_strategy_javascript/label.js @@ -30,7 +30,7 @@ candidateLabels = candidateLabels.sortBy(function(s) { }); var locatedLabel = candidateLabels.first(); -var labelFor = locatedLabel.getAttribute('for'); +var labelFor = locatedLabel.htmlFor; if ((labelFor == null) && (locatedLabel.hasChildNodes())) { return locatedLabel.getElementsByTagName('button')[0]