Bootstrap

前端面试题:判断Dom节点是否在节点内

<!DOCTYPE html>

<html lang="en">

<head>

<meta charset="UTF-8" />

<meta name="viewport" content="width=device-width, initial-scale=1.0" />

<title>Document</title>

<style>

.item {

width: 100%;

height: 200px;

border: 1px solid red;

margin-top: 20px;

}

</style>

</head>

<body>

<div class="item" data-color="red">1</div>

<div class="item" data-color="yellow">2</div>

<div class="item" data-color="blue">3</div>

<div class="item" data-color="green">4</div>

<div class="item" data-color="black">5</div>

<div class="

;