简体   繁体   English

需要onclick成为按钮而不是热链接

[英]Need onclick to be button not hotlink

I have the following code that creates a pop-up lightbox. 我有以下代码创建了一个弹出式灯箱。 However, it only shows up as a text link. 但是,它仅显示为文本链接。 I need there to be a button for people to click. 我需要有一个供人们单击的按钮。 I know virtually nothing about coding but have gotten this far - I'm sooo close. 我对编码几乎一无所知,但是到目前为止,我已经走得很近了。 Any ideas? 有任何想法吗?

<script type="text/javascript">var hide_awf_Form = true;</script>

<div class="AW-Form-##########"></div>
<script type="text/javascript">(function(d, s, id) {
    var js, fjs = d.getElementsByTagName(s)[0];
    if (d.getElementById(id)) return;
    js = d.createElement(s); js.id = id;
    js.src = "//forms.aweber.com/form/39/#########.js";
    fjs.parentNode.insertBefore(js, fjs);
    }(document, "script", "aweber-wjs-rb4ygt9a4"));
</script>

<a href="#" onclick="awf_Form_.showForm(); return false;"> Grab our Ideas Newsletter here!</a>

I need the "Grab our Ideas Newsletter here!" 我需要“在这里获取我们的想法通讯”! text to be on a button instead of just as text but with the same functionality. 文本位于按钮上,而不只是文本,而是具有相同的功能。

(Note - I inserted the ####### for my Aweber numbers) (注意-我为Aweber号码插入了#######)

Thanks for any help! 谢谢你的帮助!

~Vicky 〜玉萍

将其从“ a”标签更改为“ button”标签,如下所示:

<button onclick="awf_Form_.showForm(); return false;"> Grab our Ideas Newsletter here!</button>

You are using the 'anchor' tag, this is a 'hyperlink'. 您正在使用“ anchor”标签,这是“超链接”。 You want to be using a button as follows: 您要使用一个按钮,如下所示:

<button type="button" onclick="awf_Form_.showForm(); return false;">Grab our Ideas Newsletter here!<</button>

If you still want to link the button to a page/other content, then use the href attribute. 如果仍然要将按钮链接到页面/其他内容,请使用href属性。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM