Looking to add/remove a border based on click with Jquery

  • 12 February 2021
  • 0 replies
  • 26 views

Badge

I am currently working on an landing page that I am having trouble with one feature (My jquery / javascript experience is pretty low

here is the page for reference: http://try.muniqlife.com/muniq-recommendation/

I have six icons inside rounded boxes - when the user clicks each i was able to add a border property using:

(function () { ("#lp-pom-box-19").click(function() {
$("#lp-pom-box-19").css(‘border’, “solid 3px #0a2f25”);
});
});

What I need is to remove the border when the user clicks on it a second time (toggle selected / deselected)

I’ve tried a couple different solutions, but nothing seems to work - using a ‘toggleclass’ can’t seem to apply the class from the style sheet. I’m sure it needs an if statement or something, nothing i’ve tried is working.

Can anyone suggest how they would solve this?


0 replies

Be the first to reply!

Reply