JavaScript uses this action to be clicked on the HTML tag

The this keyword can be used to operate only the clicked HTML tag. The usage is as follows:
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled document</title>
<script>
function test(obj){
	obj.innerHTML = 'ccc'
}
</script>
</head>

<body>
<h4 onClick="test(this)">aaa</h4>
<h4 onClick="test(this)">bbb</h4>
</body>
</html>


Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324820184&siteId=291194637