Saturday, February 11, 2012
Nano Quantum Tech: placeholder for ie using jquery plugin
Nano Quantum Tech: placeholder for ie using jquery plugin: I tested for ie ( microsoft internet explore ) version 9.0.4 or above its working fine. I am trying to resovle for password ...
placeholder for ie using jquery plugin
I tested for ie ( microsoft internet explore ) version 9.0.4 or above its working fine.
I am trying to resovle for password also...
$(function () {
if ($.browser.msie) { //this is for only ie condition ( microsoft internet explore )
$('input[type="text"][placeholder], input[type="password"][placeholder], textarea[placeholder]').each(function () {
var obj = $(this);
if (obj.attr('placeholder') != '') {
if (obj.val() == '') {
obj.val(obj.attr('placeholder'))
if (obj.attr('type') == 'password') {
obj.addClass('classForPassword').attr('type', 'text');
}
}
obj.focus(function () {
if (obj.val() == obj.attr('placeholder')) {
obj.val('');
if (obj.hasClass('classForPassword')) {
obj.attr('type', 'password');
}
}
});
obj.blur(function () {
if ($.trim(obj.val()) == '') {
obj.val(obj.attr('placeholder'));
if (obj.hasClass('classForPassword')) {
obj.attr('type', 'text');
}
}
});
}
});
}
});
Subscribe to:
Posts (Atom)