Permalink
Browse files

Use `htmlFor` on IE.

[#317 state:resolved]
  • Loading branch information...
1 parent 06bb72d commit 1979a7fc7f9a2f951d1bb37e77235b12bf452001 @djanowski djanowski committed Apr 15, 2010
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/webrat/selenium/location_strategy_javascript/label.js
@@ -21,7 +21,7 @@ var candidateLabels = $A(allLabels).select(function(candidateLabel){
});
if (candidateLabels.length == 0) {
- return null;
+ return null;
}
//reverse length sort
@@ -30,7 +30,7 @@ candidateLabels = candidateLabels.sortBy(function(s) {
});
var locatedLabel = candidateLabels.first();
-var labelFor = locatedLabel.getAttribute('for');
+var labelFor = locatedLabel.getAttribute('for') || locatedLabel.htmlFor;
if ((labelFor == null) && (locatedLabel.hasChildNodes())) {
return locatedLabel.getElementsByTagName('button')[0]

0 comments on commit 1979a7f

Please sign in to comment.