开发者

Jquery - Sliding up form labels problem

I am not going to paste the whole script here, because it's too long! this is the link and the demo as well: http://www.htmldrive.net/items/show/775/Sliding-up-form-labels-with-jquery-and-CSS3

The problem i have, is that i dont know how to make it work for input:password - currently it's set开发者_运维百科 to:

jQuery( 'input:text' ).each( function( )

if i put jQuery( 'input:text, input:password' ).each( function( ) script is not working anymore!

Any solution? i don't have too much javascript or jquery knowladge - thanks!


Changing the initial selector from: jQuery('input:text') to: jQuery('input:text, input:password') makes it work for me: JS Fiddle demo (incidentally the 'zip' field is the only input:password that I used, but, still, it does work as expected).

This is in Firefox 4.x and Chromium 11 on Ubuntu 11.04, though I can't see why it shouldn't work in other browsers on other platforms.

References:

  • input:password.


Try this:

$("input:password").each(function(){
    alert($(this).attr('name'));
});

You can see it live here: http://jsfiddle.net/Uhhxf/2/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜