// 入力不可 $('#hoge').prop('disabled', true); // 入力可 $('#hoge').prop('disabled', false); $('.clearForm').bind('click', function(e){ // プルダウン選択肢を初期化 e.preventDefault(); }); // 取得 var events = []; Object.keys($._data($("#hoge").get(0), "events")).forEach(function(k) { events[k].forEach(function(o) { events.push(o.handler); }); }); // 削除 $("#hoge").off("click"); // 再登録 events.forEach(function(e) { $("#hoge").on("click", e); }); // ajaxで追加した要素への自動イベント登録 $('#content').on('click', '.js-box', function(){ console.log('boxをクリックしました!'); }); // 子孫の検索 $('.parent').find('.child'); // 直下の子の検索 $('.parent').children('.child'); // 親要素の取得 $('.child').parent(); // 指定子を子に持つ要素から検索(虫食い検索っぽい) $('.child').parent('.finder'); // 先祖要素から検索 $('.mine').parents('.finder'); // 兄弟要素から検索 $('.mine').siblings('.other'); $.ajax({ url: ajax_url, type: 'post', processData: false, contentType: false, data: formData, success: function (data, dataType) { $('tbody').before(data).remove(); }, error: function (request, status, error) { var message = request.responseText; var header_text = '
' + message + '
'; $('tbody').html(''); $('#content-header').html(header_text); } }); $.fn.tooltip = function( method ) { if ( methods[method] ) { return methods[method].apply( this, Array.prototype.slice.call( arguments, 1 )); } else if ( typeof method === 'object' || ! method ) { return methods.init.apply( this, arguments ); } else { $.error( 'Method ' + method + ' does not exist on jQuery.tooltip' ); } }; $('.js-checkbox-2-radio').on('click', function (e) { var chekced = $(this).prop('checked'); $('[name="' + this.name + '"]').prop('checked', false); $(this).prop('checked', chekced); }); $form.on('change', 'input[name="applications_payee_approval[corporate_case]"]:radio', function () { if ($(this).val() == 'person') { $form.find('.person_only').removeAttr('disabled'); $form.find('.person_only').removeClass('disabled'); } else { $form.find('.person_only').val(''); $form.find('.person_only').attr('disabled', 'disabled'); $form.find('.person_only').addClass('disabled'); } }) $('div').css('display', 'none'); $('div').css({ display: 'none', fontSize: '32px' });