Link to home
Start Free TrialLog in
Avatar of bill_home
bill_home

asked on

Extract message using Jquery

Hello Experts.

I am trying to extract "Save completed successfully" from the html below and place in a  variable using jquery or javascript. I don't know if it matters but notice that the span class id is the same for both spans.


Thanks
Bill

<div class="ui-widget advance-error">
<div class="ui-state-highlight ui-corner-all" style="padding: 0 .7em;">
<p><span class="ui-icon ui-icon-info" style="float: left; margin-right: .3em;"></span>
 MESSAGE ONE
</p>
</div>
</div>
<div class="ui-widget advance-error">
<div class="ui-state-highlight ui-corner-all" style="padding: 0 .7em;">
<p><span class="ui-icon ui-icon-info" style="float: left; margin-right: .3em;"></span>
Save completed successfully
</p>
</div>
</div>
ASKER CERTIFIED SOLUTION
Avatar of leakim971
leakim971
Flag of Guadeloupe image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of bill_home
bill_home

ASKER

Thanks leakim971,

But I can't guarantee that the " save completed" will be the last message.

Also, thanks for the link that is awesome!!

Bill
so the question is what can you guarantee? if you've no id, no unique class, no unique reference, you have no way to get your message
got it thanks!! It is a quagmire. thanks for the help.