无法正常移动到其他页面

Mar*_*ark -1 html javascript jquery

我有4个按钮.

其中三个正在展示许可证.其中一个名为"企业"的人必须转到另一页.

不幸的是,当我点击"企业"时,会显示许可证,然后页面会转到另一个页面.

我怎么做不传递代码来显示许可证,但立即传递给另一个页面?

我的代码:

$('input[title="enterprise"]').click(function(){
    window.location.href = "/contact";
});

$('input[type=button]').click(showLicence).each(function() {
    this.version = this.title;
    this.title = "Buy ";
    switch(this.version) {
        case 'basic':
            this.title += 'Basic';
            break;
        case 'standard':
            this.title += 'Standard';
            break;
        case 'business':
            this.title += 'Business';
            break;
    }
});
Run Code Online (Sandbox Code Playgroud)

Ant*_*ton 5

尝试使用 :not

$('input[type=button]:not([title="enterprise"])').click(showLicence).each(function() {
Run Code Online (Sandbox Code Playgroud)


Bar*_*mar 5

更改第二个事件处理程序,以便enterprise排除该按钮:

$('input[type=button]:not([title="enterprise"])').click(showLicence).each(function() {
Run Code Online (Sandbox Code Playgroud)