Editor Arrow Download Open
<!DOCTYPE html> <html> <head> <title>jQuery :checked Selector</title> <script src="jquery-latest.min.js"></script> <script> $(document).ready(function() { $(":checked").wrap( "<span></span>" ).parent().css("background-color", "yellow"); }); </script> </head> <body> <h1>Form Elements Selector</h1> <form action=""> Name: <input type="text" name="name" /><br /> Password: <input type="password" name="password"/><br/> <div> Favorite outdoor game: <input type="checkbox" name="vehicle" value="Bike"> Cricket <input type="checkbox" name="vehicle" value="Car" checked="checked"> Football </div> <input type="button" value="Button"> <input type="reset" value="Reset"> <input type="submit" name="submit"/> </form> </body> </html>
  Preview Arrow