// How stupid , I forgot , In the middle of the line onclick Events need to add ();,addEventListener Just use the function name 
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title> Untitled Document </title>
</head>
<body onclick="fn1()">
sdf
<div onclick="fn">click This way of binding events is to add () Of , Wonderful flowers </div>
</body>
<script>
function fn1(){
alert(1)
}
</script>
</html>

onclik Use . More articles about

  1. Jquery/js Introduced button Of onclik The event is triggered only once

    Goal description What I want to achieve is : By monitoring button Of click event , Thus through ajax towards servlet Send a request to get the data in the database , And then back to the page , And require local refresh A page load is html Direct page initialization itself ...

  2. th:onclik() The question of reference transmission ( The front end uses bootstrap)

    Most of the posts on the Internet are like this onclick transfer javascript Function time , Can't be used directly onclick=“editUser(${prod.id})”, This will give you an error , It needs to be changed to the following format . <a href= ...

  3. ASP.NET MVC Html.BeginForm Set up timeout

    Sample code : @using (Html.BeginForm("PublishSubmit", "Blog", FormMethod.Post, new { id ...

  4. Android On the event distribution mechanism ( 3、 ... and )-- Source code analysis (View piece )

    When writing event distribution source code analysis, it's very tangled , Many blog posts on the Internet are analyzed first View, Post analysis ViewGroup. Because I started to understand it by following my flowchart , I feel the direction is right , When it comes to specific analysis, it's always stumbling , Always jump to Vi ...

  5. How to ban internal viewPager slide

    as everyone knows ,viewPager It can slide , But sometimes we need to ban it from sliding ( Face with a smile *----*). Here's the thing : activity There is one of them. viewPager,viewPager Add 3 individual Fragme ...

  6. ( turn ) be based on jQuery Of form turn json Example

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  7. Python The way -python(css Layout 、JavaScript)

    CSS Layout JavaScript css Layout : Background management interface 1 :( There's a menu on the left and right ) utilize position: absolute; Fix a label in a specific position , And then use overflow: auto; attribute ...

  8. jquery Prevent bubbling

    <div onclick="a()"> <p onclick="b()"></p> </div> div and p Elements ...

  9. jQuery Selectors ( One )

    I have nothing to do at night , Just to sort out jQuery Selector , After all, it's not learning without a summary . First , Handling of events . Traverse DOM and Ajax operation , All depend on selectors . 1.CSS Selectors To use a HTML Elements , You have to find it first , and c ...

Random recommendation

  1. django:field Field type

    Field type (Field types) AutoField It's a basis for ID Self increasing IntegerField Field . Usually , You don't have to use this field directly . If you don't specify a master on another field key ,Django It will automatically ...

  2. NFC Application example

    package com.example.mynfcdemon; import android.app.Activity;import android.nfc.NfcAdapter;import and ...

  3. asp.net TreeView And XML In combination with v1.1

    I was just doing Tree view I fumbled for it when binding , Someone on the Internet said TreeView Bind data source , What kind of recursive binding , I don't want to see it anymore , I tried to write one myself Here's how I do it , If you have any questions, please ask the great God for guidance , I'm a rookie .. 1: ...

  4. Spring Business management -- Multiple ORM Analysis of the framework in use

    The company's project is coming to an end , Summarize the technologies used in the project , I found that some things in the project are still vague , Just know how to use it . I don't know how it works . Because the company's projects are older , yes 7 A project a year ago , There's always someone in the middle to maintain , Also in ...

  5. noip Popularization group 2007 Hanoi The twin tower problem

    Hanoi The twin tower problem describe Given A,B,C Three thin columns long enough , stay A There are... On the post 2n A disc with a hole in the middle , share n It's a different size , Each size has two identical disks , Note that the two disks are indistinguishable . Now move these disks to C On the column , In mobile ...

  6. 【 note 】【VSCode】Windows Next VSCode Compile debugging c/c++

    Reprinted from http://m.2cto.com/kf/201606/516207.html First of all, look at the effect To set breakpoints , Monitor variables , Call stack view : Use of conditional breakpoints : Here is the configuration process : Overall process : Download and install vsco ...

  7. vue vuex vue-rouert Backstage projects —— Authority routing ( Super detailed simple version )

    Project address :vue-simple-template There are three roles :adan barbara carrie The passwords are all :123456 adan Have Highest authority A He can see red , yellow and blu ...

  8. Ansible And ansible-playbook roles

    Just started learning to use playbook when , May put playbook It's a huge document , Later, you may want these files to be easy to reuse , So we need to reorganize these files . Basically , Use include Statement reference ...

  9. HDU 5200 Trees Two points

    Topic link : hdu:http://acm.hdu.edu.cn/showproblem.php?pid=5200 bc( chinese ):http://bestcoder.hdu.edu.cn/contests ...

  10. 【 turn 】 The easiest thing to understand in history Git course !

    I've been looking for it before git Course of study , I found a lot on the Internet , But most of the writing is very simple or confusing , You know, the thinking of a technical man is that he throws a technical term out , I thought you knew everything …… Or simply write two sentences , Insert a picture , He felt that he understood , You can understand , In fact, beginners ...