javascript - JQuery - 我该怎么做才能完成这项工作?

标签 javascript jquery

http://jsfiddle.net/piezack/X8D4M/5/

我需要通过单击要检测的按钮创建的更改。目前,您必须在字段内部单击,然后在字段外部单击,才能检测到任何更改。

谢谢大家。

按钮的代码无法更改。不过到目前为止,尝试还不错。

让事情变得过于复杂。回答http://jsfiddle.net/piezack/X8D4M/56/

最佳答案

Example使用trigger :

//waits till the document is ready
$(document).ready(function() {

    $('button.butter').click(function() {
        var $form6  = $('#FormCustomObject6Name');
        $form6.val('Text has changed');
        $form6.trigger('change')
    });

    $('#FormCustomObject6Name').change(function() {
        var x = $('#FormCustomObject6Id').val();

        $("a").filter(function() {
            return this.href = 'http://www.msn.com'
        }).attr('href', 'http://www.google.com/search?q=' + x);
        alert(x);
    });

});

关于javascript - JQuery - 我该怎么做才能完成这项工作?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7600144/

相关文章:

javascript - slider 革命 + BarbaJS (PJAX)

javascript - asp.net mvc中物理文件的临时url

javascript - 如何在两个 parent 之间转换一个div?

javascript - RegEx 删除背景颜色和颜色属性,但将所有样式保留在 php 中

javascript - 将带有ajax请求的数组发送到php

php - 尝试将数组从 jquery 发送到 PHP 函数

javascript - 从 textarea 对象获取 textarea 值

javascript - 如何得到N个和等于M的随机整数

javascript - d3 以文本形式强制定向节点 - 计算相对箭头指向位置

javascript - 根据用户计算机的性能禁用 JavaScript 功能