JQuery Selector reset

From CoderLearner
Jump to: navigation, search

Description

Select elements that it has a reset type.

Syntax

$('input:reset')

$('input[type="reset"]')

Note

For better performance use $('input[type="reset"]')

Example 1

<html>
   <head>
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <title>Select</title>
      <script 
         type="text/javascript" 
         src="/lib/jquery-1.7.2.min.js">				 
      </script>

      <script>
         $().ready(function() {
            $('input[type="reset"]').css('border','3px solid red');
         });
      </script>
   </head>
   <body> 
      <form>
         <table>
            <tr>
               <td class="lb">Email Login :</td>
               <td>
                  <input type="text" name="uname" value="" class="required"/>
               </td>
            </tr>
            <tr>
               <td class="lb">Password :</td>
               <td>
                  <input type="password" name="pwd" value="" class="required"/>
               </td>
            </tr>

            <tr><td><input type="reset" value="Reset" /></td>
                    <td><input type="submit" value="Login" /></td></tr>
         </table>
      </form>
   </body>
</html>

Try It