2017-01-17 4 views
0

ラジオボタンとjqueryに問題があります。 onchangeはChromeで動作していますが、Mozilla Firefoxでは動作していません。私は、Chromeで以下の行にブレークポイントを入れて、ブラウザが正常にデバッグしているが、私はMozillaの上だとき、これは、最大発射決してれるonchange

$(document).on("change", 'input[type="radio"]', function() {//code for doing something} 

私のHTMLコードは、最小限のマークアップ

<div id="tab-Pcy-2041" class="tab-pane active"> 
    <div class="radio radio-small"> 
     <label class=""> 
      <div class="i-radio checked"> 
       <input class="i-radio" data-ano="1" data-chno="0" 
       data-adce="0" data-chce="0" data-for="rbtncy" 
       xname="rbcy204" name="rbtncy2040" value="22038" 
       checked="checked" style="position: absolute; opacity: 0;" type="radio" /> 
       <ins class="iCheck-helper" style="position: absolute; top: 0%; left: 0%; 
       display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; 
       background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 
       0px none; opacity: 0;"> 
       </ins> 
      </div> 
     test 
     </label> 
    </div> 
    <div class="radio radio-small"> 
     <label class=""> 
      <div class="i-radio"> 
       <input class="i-radio" data-ano="1" data-chno="0" 
       data-ace="15" data-chce="15" 
       data-for="rbtncy" xname="rbtncy204" 
       name="rbtncy2040" value="22039" 
       style="position: absolute; opacity: 0;" type="radio" /> 
       <ins class="iCheck-helper" style="position: 
       absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; 
       margin: 0px; padding: 0px; background: rgb(255, 255, 255) 
       none repeat scroll 0% 0%; border: 0px none; opacity: 0;"> 
       </ins> 
      </div> 
      test33: 
      <span class="ItemtestClass" data-itemce="15"> 
       <span class="CurrencySymbolClass">€</span> 
       <span class="Itce"> 15</span> 
      </span> 
      Cd: 
      <span class="ItemtestClass" data-itemce="15"> 
       <span class="CurrencySymbolClass">€</span> 
       <span class="Itemce"> 15</span> 
      </span> 
     </label> 
    </div> 
</div> 
+0

あなたがMozillaと言うとき、あなたはFirefoxを正しく意味しますか? –

+0

どのバージョンのChrome/Firefoxをお使いですか? jqueryのどのバージョンを使用していますか? –

+0

あなたは最新バージョンのFirefoxを使用していますか? –

答えて

0

ですスクリプトあなたは

$(document).on("change","input[type=radio]", function(){ 
 
    console.log($(this).prop("id")); 
 
})
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> 
 
<input type="radio" name="rd1" id="option1" /><label for="option1">Option 1</label><br /> 
 
<input type="radio" name="rd1" id="option2" /><label for="option2">Option 2</label><br /> 
 
<input type="radio" name="rd1" id="option3" /><label for="option3">Option 3</label><br />

以下の作業スニペットを参照することができます
+0

これは機能しません。コンソールの火災ではありません – focus

+0

あなたはどのFirefoxのバージョンを使用していますか?私はWindows上でうまく動作48.0.2私の持っている – mylee

関連する問題