  The Moser-Trudinger embedding has been generalized in [Adimurthi A.; Sandeep
K., A singular Moser-Trudinger embedding and its applications, \textit{NoDEA
Nonlinear Differential Equations Appl.}, 13 (2007), no. 5-6, 585--603] to the
following weighted version: if $\Omega\subset\mathbb{R}^n$ is bounded,
$\omega_{n-1}$ is the $\mathcal{H}^{n-1}$ measure of the unit sphere, then for
$\alpha>0$ and $\beta\in [0,n)$, $$
  \sup_{u\in\mathcal{B}_1}\int_{\Omega}\frac{e^{\alpha
|u|^{n/(n-1)}}}{|x|^{\beta}}\leq C \ \Leftrightarrow \
\frac{\alpha}{\alpha_n}+\frac{\beta}{n}\leq1,\qquad $$ where $\alpha_n=n\cnn$
and $\mathcal{B}_1 = \left\{ u \in W_0^{1, n}(\Omega) \ | \ \int_{\Omega}
|\nabla u |^n \leq1 \right\}$. We prove that the supremum is attained on any
domain $\Omega$. The paper also fills in the gaps in the proof of [Lin K.C.,
Extremal functions for Moser's inequality, \textit{Trans. of. Am. Math. Soc.},
384 (1996), 2663--2671], which deals with the case $\beta=0.$
