我有一個包含3個部分的表單。每個部分都有一個專用的div,用於處理關注焦點的輸入的相當長的上下文幫助信息。jQuery - 搜索前一個選擇器,相對於當前的
我的問題是,如果我給這些幫助div中的每一個「form-tip」類和每個輸入提示類「has-tip」,我怎麼能得到提示總是顯示在以前的「form-tip」div?
喜歡的東西:
$('.has-tip').each(focus(function() {
var tip = $(this).attr('title');
// Find most recent $('.form-tip') in the DOM and populate it with tip
}));
我希望是有道理的......感謝您的幫助。