I want to use the labelsFX plugin to turn label text into text in input fields which fade out on focus. This is fine apart from the fact that select dropdown boxes break if i try to apply the effect to the adjacent label. So I only want to apply this开发者_开发问答 effect where the label is adjacent to a text or textarea input field.
So what I want to do is something like this, but it's clearly not right - anyone know how to fix this?
$('label').next('not:(select)').labelsFX();
You could always do something like this:
$("label + input, label + textarea").prev()
Example: http://jsfiddle.net/Xeon06/8Kxnb/1/
You could select all the textfields using the following selector:
$("input[type='text']")
try this syntax:
$('input, textarea').labelsFx();
精彩评论