reset selector in jQuery with example
reset selector returns all input elements with type reset.
Example :
<html>
<head>
<title>reset Selector</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"> </script>
<script type="text/javascript">
$(document).ready(function()
{
$("#myButton").click(function()
{
$(":reset").text("Hello World");
});
});
</script>
</head>
<body>
<button type="reset" id="submitButton">Reset</button>
<button type="button" id="myButton">Click Me</button>
<button onclick="location.reload()">Reset</button>
</body>
</html>
Demo :
In the above example, we have used reset selector. Reset selector return all input elements with type reset. In the above example the reset selector selects the reset button and changes its text on button click.
0 comments:
Post a Comment