JQuery onclick function to focus input

<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>

<script>
    function high(){
    $("#in12").focus();
}


</script>
<style>

</style>
</head>
<body>

<input id="in12">

<p>Click on "check" button to get focus on input field "in11".</p>

<button id="b1" value="sdf" onclick="high();">check</button>
</body>
</html>

Output==> 

Comments

Popular posts from this blog

datatable with both top and bottom scroll bar.

Display Loader and disable page while waiting for ajax request

Remove GIT integration from VSCode