Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(".clickableUL").click(function() {
- $(this).find("li a").addClass("active");
- });
- // javascript
- $("li>a").click(function(){
- $(this).parent().toggleClass("clicked");
- });
- /* CSS */
- li { background: blue; }
- li.clicked { background: red; }
- $("li").click(function(){
- $(this).toggleClass("clicked");
- });
- $('a').click(function(evt) {
- $(evt.target).parent().css('background-color', '#fff');
- });
Add Comment
Please, Sign In to add comment