Hiya @youchuan990316 You should be able to do this using javascript. I'm not familiar with particular libraries or methods, but google has a number of options.

You can modify the Account two-factor enable theme page.

Hope this helps.