动态创建和“点击”与jQuery的链接 [英] Dynamically create and "click" a link with jQuery

查看:105
本文介绍了动态创建和“点击”与jQuery的链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想动态创建< a href =mailto:...> 元素,然后点击它。所有这些都没有修改页面。

I want to dynamically create an <a href="mailto:..."> element, then "click" it. All without modifying the page.

我正在尝试这个:

$('<a href="mailto:test@test.com">&nbsp;</a>').click();

...无济于事

推荐答案

点击链接意味着更改window.location,那么如何

Clicking on a link means changing window.location, so how about

window.location = "mailto:test@test.com";

这篇关于动态创建和“点击”与jQuery的链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆