Link to home
Create AccountLog in
Avatar of erikTsomik
erikTsomikFlag for United States of America

asked on

jquery click problem

When i click on the div with a specific id I am changing the class so it can not be clicked second time. However , the class is being changed but i can still click on the div
                  var currentId = $(this).attr('id').substring(5);
                  $('#item_'+currentId).attr('class', 'btnComplete');


<div class="btnNotComplete" id="item_1">Mark Complete</div>
Avatar of Gary
Flag of Ireland image

The class still exists in the dom so use the following which is reacting to changes to the page.


That should be on, bad habit
Avatar of erikTsomik


it still does not work
padas check the link I posted it still does not work
Doh! That's because you have the library set to prototype and  not jquery
I think I figured out
The link I first gave you was fine.  The top line of the js should really be

Avatar of Chris Stanyon
Chris Stanyon
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
Create an account to see this answer
Signing up is free. No credit card required.
Create Account