这是jquery的表单验证:
http://www.position-absolute.com/articles/jquery-form-validator-because-form-validation-is-a-mess/
我需要这样的东西,但是当我通过单击选择输入文本表单时,提示必须出现,而当我选择另一个输入文本表单时,提示必须消失。
有没有办法使用jquery、mootools、scriptaculus或其他库来做到这一点?
谢谢^_^
发布于 2010-05-30 16:24:59
在jquery中,我会这样做:
$('input').focus(function(){
$(this).sibling('div.form_tooltip').show();
});
$('input').blur(function(){
$(this).sibling('div.form_tooltip').hide();
});对应的html:
<div class="form_input">
<label for="..">label</label>
<input type="text" name="" id="" value="" />
<div class="form_tooltip" style="display: none;">
Here goes the html that appears in the tooltip, you probably want this div to be positioned relatively to the div.form_input.
</div>
</div>https://stackoverflow.com/questions/2937933
复制相似问题