This paper is devoted to the study of the difference gap (for brevity, D-gap) function and global error bounds for a class of elliptic variational inequalities (for brevity, EVIs). Firstly, we establish the regularized gap function introduced by Yamashita and Fukushima for EVIs under some suitable conditions. Then the D-gap function for EVIs is proposed by employing these regularized gap functions. Furthermore, we also develop the global error bounds for EVIs in terms of the regularized gap function of the Fukushima type and the D-gap function. Finally, an application to frictional contact problem is given to illustrate our main results.