javascript - How to remove a class on click event? -


html:

<!doctype html> <html> <head>     <link rel="stylesheet" type="text/css" href="style.css"/>     <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>     <script type="text/javascript" src="app.js"></script>      <title>prueba</title> </head> <body>     <div class="prueba"></div> </body> </html> 

css:

.prueba {     height: 100px;     width: 100px;     background-color: green; } 

js (edited):

var main = function() {     $('.prueba').click(function() {         $(this).removeclass('.prueba');     }); };  $(document).ready(main);  

it (still) doesn't work. can me?

to select class, should preface class name dot:

$('.prueba') 

jquery docs may want review.


Comments

Popular posts from this blog

Load Balancing in Bluemix using custom domain and DNS SRV records -

oracle - pls-00402 alias required in select list of cursor to avoid duplicate column names -

python - Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>] error -