<html>
<head lang="zh-CN">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Hello</title>
<script src="js/jquery-3.3.1.js"></script>
<script>
$(document).ready(function () {
$("p").click(function () {
$(this).hide();
});
});
</script>
</head>
<body>
click
</body>
</html>
bind events to elements like < p onclick="xx" >
, and < script > p.click=xx
or p.addEventListener < / script >
. After clicking, call the corresponding function to understand
but how does jquery listen to this event anytime and anywhere after clicking click with jquery,?
there is no explicit code, listening and binding events
after listening for an event, how do you bind the event to a specific function?
topic description
sources of topics and their own ideas
related codes
/ / Please paste the code text below (do not replace the code with pictures)