Answers for "IS MOBILE"

0

IS MOBILE

<!DOCTYPE html>
<html>
<head>
	<title>Mobile Test</title>
</head>
<body>

	<p id="text"></p>

	<script type="text/javascript">
		var isMobile = /iPhone|iPad|iPod|Android/i.test(navigator.userAgent);
		var element = document.getElementById('text');
		if (isMobile) {
  			element.innerHTML = "You are using Mobile";
		} else {
			element.innerHTML = "You are using Desktop";
		}
	</script>
</body>
</html>
Posted by: Guest on July-01-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language