Permalink
Browse files

IE fix

  • Loading branch information...
1 parent 7ee43d9 commit 66ed1b3b1edfc68c0b1c32110a8937b43195bdab @nachokb committed Dec 21, 2011
Showing with 10 additions and 6 deletions.
  1. +2 −3 demo.html
  2. +8 −3 jquery.hint-with-password.js
View
@@ -4,7 +4,7 @@
<meta content='IE=EmulateIE8' http-equiv='X-UA-Compatible' />
<meta content='text/html; charset=UTF-8' http-equiv='Content-Type' />
<title>jQuery Hint + Password Support</title>
- <script src='http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js' type='text/javascript'></script>
+ <script src='http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.js' type='text/javascript'></script>
<script src='jquery.hint-with-password.js' type='text/javascript'></script>
<script type="text/javascript" charset="utf-8">
$(function(){
@@ -22,9 +22,8 @@
<label for="text1">A text input:</label>
<input type="text" id="text1" name="text1" title="username" />
<label for="password1">A password input:</label>
- <input type="password" id="password1" name="password1" title="password" />
+ <input type="password" id="password1" name="password1" title="password" style="width: 150px;" />
<p>The password field should keep its green border both when it's blurred and focused.</p>
</form>
</body>
</html>
-
@@ -66,10 +66,15 @@ $.fn.hint = function (blurClass) {
replaceElement: {
init: function() {
- // create alternative text input element with title as value
- var $alt = $input.clone();
$input.addClass("replaced-for-title");
- $alt.attr("id", null).attr("type", "text")
+
+ // create alternative text input element with title as value
+ var $alt = $('<input type="text"></input>').attr({
+ 'class': $input.attr('class'),
+ 'name': $input.attr('name'),
+ 'title': $input.attr('title'),
+ 'style': $input.attr('style')
+ })
.val(title)
.insertBefore($input)
.addClass("password-title")

0 comments on commit 66ed1b3

Please sign in to comment.