I have been trying to automate the password reset functionality. So when the email is available we get a message and when not another message, both are in the same tag but dynamic depending on the email id. How to display this dynamic text?

The source code is 

```
if($.trim(response) == '1'){
$(".resultreset").html("<div class='alert alert-success'>New Password sent to "+resetemail+", Kindly check email</div>");
}else{
$(".resultreset").html("<div class='alert alert-danger'>Email Not Found</div>");
} }); });

```

The tags are like

```
<div class="resultreset">
<div class="alert alert-danger">Email Not Found</div>
</div>

```

and

```
<div class="resultreset">
<div class="alert alert-success">New Password sent to "xxx@xxx.com", Kindly check email</div>
</div>

```

How to get the text "Email Not Found" or New Password sent to `"xxx@xxx.com"`, Kindly check email and display using JAVA in selenium webdriver.

I have tried to locate it using the xpath .//\*`[@id='passresetfrm']/div[1]/div/text()`, but the webdriver is not able to locate the element. 
Also tried with `driver.findElement(By.classname("alert")).gettext();`, even this is not recognized.

It locates the class, but not the message.

The complete source code for the forgot password section 

```
<div id="ForgetPassword" class="modal wow fadeIn animated animated in" tabindex="" role="dialog" aria-labelledby="ForgetPassword" aria-hidden="true" style="visibility: visible; animation-name: fadeIn; display: block; padding-right: 17px;">
<div class="modal-dialog modal-sm">
<div class="modal-content">
<div class="modal-header">
<button class="close" type="button" data-dismiss="modal" aria-hidden="true">
<span class="ink animate" style="height: 21px; width: 21px; top: 2.5px; left: -5.56665px;"></span>
×
</button>
<h4 class="modal-title">
<i class="fa fa-asterisk"></i>
Forget Password
</h4>
</div>
<div class="modal-body">
<form id="passresetfrm" method="POST" action="" accept-charset="UTF-8" onsubmit="return false;">
<div class="resultreset">
<div class="alert alert-danger">Email Not Found</div>
</div>
<div class="input-group">
<input id="resetemail" class="form-control" placeholder="your@email.com" name="email" required="" type="text">
<span class="input-group-btn">
<button class="btn btn-primary resetbtn" type="submit">
<span class="ink animate" style="height: 62px; width: 62px; top: -98.7167px; left: -11.5167px;"></span>
Reset
</button>
</span>  
</div> 
</form> 
</div> 
</div> 
</div> 
</div> 

```