Skip to content

Commit

Permalink
Make sure the new stylesheet is first so user overrides take effect
Browse files Browse the repository at this point in the history
  • Loading branch information
James Allardice committed Mar 19, 2013
1 parent 81886f9 commit cfaca8f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/Placeholders.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"textarea"
],
test = document.createElement("input"),
head = document.getElementsByTagName("head")[0],
placeholderStyleColor = "#ccc",
placeholderClassName = "placeholdersjs",
classNameRegExp = new RegExp('\\b' + placeholderClassName + '\\b'),
Expand Down Expand Up @@ -156,7 +157,7 @@
}

//Append new style element to the head
document.getElementsByTagName("head")[0].appendChild(styleElem);
head.insertBefore(styleElem, head.firstChild);

// Set up the placeholders
for (i = 0, len = inputs.length + textareas.length; i < len; i++) {
Expand Down

0 comments on commit cfaca8f

Please sign in to comment.