var am = readerControl.docViewer.GetAnnotationManager();
annotation = am.getAnnotationById(previousHighlightKey);
if(annotation !=null)
{
am.HideAnnotation(annotation); // or am.hideAnnotation(annotation);
}
var am = myWebViewer.getInstance().docViewer.GetAnnotationManager(); // where myWebViewer is the default variable name for the WebViewer instance in the sample HTML files.
annotation = am.getAnnotationById(previousHighlightKey);
if(annotation !=null)
{
am.HideAnnotation(annotation); // or am.hideAnnotation(annotation);
}