Get and set name of the button using jQuery

  Uncategorized

 Get and set name of the button using jQuery

<html>
<head>
    <title></title>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {

            //seeting value of the button name
            $('#btnName').val("Submit button");
            //getting value of the button name.
            alert($('#btnName').val());
        });
    </script>
</head>
<body>
    <input type="button" id="btnName" />
</body>
</html>

 

5 thoughts on - Get and set name of the button using jQuery

LEAVE A COMMENT