OnClick 可以做两件事吗? [英] Can OnClick do 2 things?

查看:26
本文介绍了OnClick 可以做两件事吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是html代码...

<div id="Div1"><input id="Button1" type="button" value="&#9658;"onclick="switchVisible();"style="font-size: 40px; font-weight: bold; line-height: 2; background-color: #000; text-align: center; color: #fff; margin-bottom: 0px; z-index: 102; 背景: url('.get_post_meta(get_the_ID(), 'fifu_image_url', TRUE).') 不重复;背景尺寸:封面;位置:相对;填充底部:56.25%;填充顶部:0px;高度: 0; margin-bottom: 0px; width: 100%; font-size: 120px; line-height: 5;"/>

<div id="Div2" class="video-embed" style="font-size: 40px; font-weight: bold; line-height: 2; background-color: #000; text-align: center; color: #fff; margin-bottom: 0px; z-index: 102;display:none;">'.do_shortcode('[video_display]').'

这是脚本...

我想在新的弹出窗口或新窗口中添加 url opening 也是 onclick 输入

类似……

https://www.facebook.com/sharer/sharer.php?u=<?php echo urlencode( get_permalink( get_the_ID() ) );?>

有可能吗?

解决方案

最好的方法是使用 addEventListener,而完全忘记 onclick 属性.删除

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