If there is plain text inside a div
with class="x95qze"
, how can we add cursor:pointer
only to the second div
that contains the text Cursor pointer required here
.
The div
with class="x95qze"
will not change. The content of the div
may be added or removed using JavaScript.
cursor:pointer
should only be applied when there is text within div class="x95qze
<!DOCTYPE html>
<html>
<head>
<title>Cursor</title>
</head>
<body>
<div class="x95qze">
<div class="RiYDI">No cursor pointer required here</div>
</div>
<div class="x95qze">Cursor pointer required here.</div>
</body>
</html>
CSS:
.x95qze {
border:1px solid black;
padding:5px;
}
.x95qze .RiYDI {
border:1px solid black;
width:50%
}