I have shared code in HTML. I want the feature in LWC. Please run the code and check.
<!DOCTYPE html>
<html>
<body>
<p>Click the input field to select the contents of the text field.</p>
Name: <input type="text" id="myText" name="myText" value="Mickey" onclick="myFunction()">
<script>
function myFunction() {
document.getElementById("myText").select();
}
</script>
</body>
</html>
You can also check the above code from the link. Click on the link and RUN https://www.w3schools.com/code/tryit.asp?filename=GGCN736KKCJJ
My LWC Code
<lightning-input class="slds-inputNo-fld" value={ActualYield}
variant='label-hidden' data-policyid={PolicyId}
type="number" min="0" max="9999"
step="0.01" onclick={handleClickActualYield}></lightning-input>
handleClickActualYield(event){
console.log(event.target) ;
event.target.select();
console.log(event.detail) ;
}