更改输入文本值并添加新链接

时间:2015-05-14 16:53:11

标签: javascript jquery jquery-selectors

在这个page上,我想改变#34;卖完了"在按钮上,即将推出",然后将此链接指向新页面。

我该怎么做?

HTML

$(e.target).find(selectors.SUBMIT_ADD_TO_CART).attr('disabled', true).addClass('disabled');

一些Jquery

if ($query = mysqli_query($link, "SELECT header FROM data WHERE var = '$foo'")) {

        $header = mysqli_fetch_assoc($query);

        if ($header) {

            // The variable with value $foo exists.
        }
        else {

            // The variable with value $foo doesn't exist.
        }
    }
    else {

        // The query didn't execute for some reason. (Dammit Obama!)
    }

3 个答案:

答案 0 :(得分:0)

好吧,将值更改为即将推出。

x

接下来在您的表单中更改操作。

x.method()

你的意思是你想用Jquery做这个吗??

答案 1 :(得分:0)

$('.add-to-cart').on('click', function(e){
    var $this = $(this);

    if ($this.is(':disabled')) {
        $this.prop('disabled', false);
        $this.val('Coming Soon!');
        e.preventDefault();
    } else {
        /* do logic to go to other page if needed */
    }
});

答案 2 :(得分:0)

更改提交输入的值

$('#add').val('Coming soon!');

$('#add').attr('value','Coming Soon!');