jquery字符串拼接
发布日期:2021-05-14 16:16:23 浏览次数:22 分类:原创文章

本文共 502 字,大约阅读时间需要 1 分钟。

<!DOCTYPE html><html><head><meta charset="utf-8"><script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"></script><script>$(document).ready(function(){
let color = "_blank" $("button").click(function(){
$("a[target='"+color+"']").hide();//实现拼接自定义变量color });});
</script></head><body><h2>这是标题</h2><p>这是一个段落。</p><p>这是另外一个段落。</p><p><a href="//www.runoob.com/html/" target="_blank">HTML 教程</a></p><p><a href="//www.runoob.com/css/">CSS 教程</a></p><button>点我</button></body></html>

在这里插入图片描述

上一篇:阿里云将静态html网页部署至云服务器
下一篇:jquery获取本地json数据

发表评论

最新留言

第一次来,支持一个
[***.219.124.196]2025年04月23日 02时03分18秒

关于作者

    喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!

推荐文章