显示< div>当用户点击具有href“#”的链接时, [英] Show a <div> when the user clicks a link with href "#"

查看:145
本文介绍了显示< div>当用户点击具有href“#”的链接时,的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每次用户点击链接时,脚本都应检查文档。如果 href ,那么脚本应显示带有ID video的div。

The script should check the document every time the user clicks a link. If the href is #, the script should show a div with the ID video.

(我需要这个特定的图片作为图片库的补丁。我无法为特定的内容使用属性属性)

(I need this specific piece as a patch for an image gallery. I'm having trouble using the title attribute for specific content for different images in the gallery.)

伪代码:

Pseudo code:

If user clicks <a> with href="#"
Show div #video


推荐答案

$('a[href="#"]').click(function(){
    $("#video").show();
});

这篇关于显示&lt; div&gt;当用户点击具有href“#”的链接时,的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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