JQuery does not work in Internet Explorer using mvc

I have a group of radio buttons that are generated on the fly from db to a partial control and then displayed on the page as html, and they all have the same name now in firefox and chrome, the following code works fine

$(".FlightSelectedRadio").live('click', function() {
    alert("after flight select");
    $("#ToisGarantueedBid").attr("disabled", false);
});

however, i.e. It does not work the first time you select a radio, but only works if you choose something else? any ideas that might be related to the problem?

+3
source share
2 answers

Lazarus, right! The code you write must be executed after the jQuery events are fired, which can be executed in two ways.

1) Like Lazarus

$(function() { 
     // your code here.
});

2) .

$(document).ready(
   function() {
       // your code here.
   }
);
+1

, jquery ajax, , isntead

0

Source: https://habr.com/ru/post/1744343/


All Articles