我是否可以像这样编写来调用锚标记中的onclick函数 [英] Can I write like this for calling the onclick function do in the anchor tag

查看:66
本文介绍了我是否可以像这样编写来调用锚标记中的onclick函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试着让函数onclick下面的代码,但我不能在这种情况下帮助我



我尝试过的:



  • 退出

    $(文件).ready(function(){

    $(#A a)。click(function(){

    alert(logouttime);



    });

    });

  • I tried to get the function onclick for the code below but i can't please help me in this context

    What I have tried:

  • Logout
    $(document).ready(function () {
    $("#A a").click(function () {
    alert("logouttime");

    });
    });
  • 推荐答案

    (文件).ready(function(){
    (document).ready(function () {


    (#A a。)。点击(function(){

    alert(logouttime);



    });

    });

    ("#A a").click(function () {
    alert("logouttime");

    });
    });


    没有足够的上下文。你的HTML代码在哪里?无论如何,请从以下示例中获取线索:

    There isn't enough context. Where is your HTML code? Anyway, take clue from the following example:
    <!DOCTYPE html>
    <html>
    <head>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
    <script>


    这篇关于我是否可以像这样编写来调用锚标记中的onclick函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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