Getting the User Agent with JavaScript

前端 未结 2 1439
花落未央
花落未央 2020-11-29 02:47

I\'d like to get a script that can grab the user\'s user agent and prop it to an attribute.

I\'m making a website problems contact form and I usually need to know wh

2条回答
  •  Happy的楠姐
    2020-11-29 03:14

    Original Q didn't say anything about jQuery. so

    document.getElementById('UserAgent').value = navigator.userAgent;
    

提交回复
热议问题