Copy the code code as follows:
<html>
<head>
<title>Automatically select text box content in response to mouse</title>
</head>
<body>
<input id="a" type="text" value="Please enter search terms" onmouseover="selectInputContent(this.id)"/>
<script type="text/javascript">
function selectInputContent(n){
obj =document.getElementById(n);
obj.focus();
obj.select();
}
</script>
</body>
</html>