jQery function fires unexpectedly from alert OK button

ساخت وبلاگ

Vote count: 0

I've got radio buttons with class="cb". Click any .cb button and a little function clears the outlines on the buttons. Here's the function: It works correctly.

$(".cb").click(function(){ $('.cb').css({'outline-color':'none','outline-style':'none','outline-width':'none'});
});

If I also want to clear the same outlines when a regular button (i.e., not radio) is clicked, I run into trouble. The button group is class="butt". Here's the amended code:

$(".cb, .butt").click(function(){ $('.cb').css({'outline-color':'none','outline-style':'none','outline-
width':'none'});
});

Now the problem: If there's an alert open and the amended code exists, the function fires when the "OK" button in the alert is clicked. I've tried separate functions, tried identifying the (non-radio) buttons by their ids, etc. but no matter what the outlines on the radio buttons clear when the OK button in the alert is clicked.

Any ideas?

asked just now
Mfffffffffffff

back soft...
ما را در سایت back soft دنبال می کنید

برچسب : نویسنده : استخدام کار backsoft بازدید : 280 تاريخ : دوشنبه 27 شهريور 1396 ساعت: 1:53