Write a jQuery code to set value in input text

 Write a jQuery code to set value in input text

Write a jQuery code to set value in input text

Answer : 
File Name : jQuery.html

<html>
<head>
    <script src="https://code.jquery.com/jquery-3.6.0.js" integrity="sha256-H+K7U5CnXl1h5ywQfKtSj8PCmoN9aaq30gDh27Xc0jk=" crossorigin="anonymous"></script>
    <title>SP Creation</title>
</head>
<body>
    <div class="container">
        <div class="col">
            <div class="col-md-3">
                <label for="name">Name</label>
            </div>
            <div class="col">
                <input type="text" name="name" id="name" class="form-control">
            </div>
            <div class="col-md-3">
                <label for="add">Address</label>
            </div>
            <div class="col">
                <input type="text" name="add" id="add" class="form-control">
            </div>
        </div>
    </div>
    <script>
        $(document).ready(function(){
            $('#name').val("SP Creation");
            $("#add").val("Mumbai Bendra"); 
        });
    </script>
</body>
</html>
Write a jQuery code to set value in input text Write a jQuery code to set value in input text Reviewed by technical_saurabh on April 30, 2021 Rating: 5

No comments:

Powered by Blogger.