Need Knowledge base Interactive Version Ajax Progress Bar Ic

The interactive version produces an ajax-loader icon on querying for questions from the search bar.Can you provide me a sample snippet on the implementation of the icon on the search input field.

It just show animated gif image when search started and hide it after data loading.
Someting similar to

document.getElementById(“progress”).style.display=‘block’; //show progress
//render output
document.getElementById(“progress”).style.display=‘none’; //hide progress