我有一个简单的设置,但我不确定当我将鼠标悬停在第二个div上时如何定位第一个div。下面是一个例子,我不能得到第二个div来定位悬停的第一个div。任何帮助都会很棒。
public void find(ArrayList<Plants> pl) {
boolean found = false;
int i = 0;
String inputName = null;
System.out.println("Enter the ID or partial ID of the plant you would like to find: ");
inputName = input.nextLine();
String nameCaps = inputName.toUpperCase();
while(!found && i < pl.size()) {
String id = pl.get(i).getId();
if (id.equals(nameCaps)) {
found = true;
System.out.println(pl.get(i).toString());
}
else {
i ++;
}
}
if (!found) {
System.out.println("A plant with that ID does not exist");
}
} // find end
<div id="container">
<div id="one">Some text.</div>
<div id="two">Some more text.</div>
</div>