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
Original Q didn't say anything about jQuery. so
document.getElementById('UserAgent').value = navigator.userAgent;
document.getElementById('UserAgent').value = navigator.userAgent;
<input type="text" id="UserAgent">
$('#UserAgent').val(navigator.userAgent);
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<input type="text" id="UserAgent">