English 中文(简体)
j Query Radio button
原标题:jQuery Radio button
  • 时间:2011-10-03 13:00:13
  •  标签:
  • jquery

我很想知道,在你选择一个无线电台时,为什么在独立党上这样做?

<html>
<head>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$("input[name= crkbrd ]").change(function(){
    if ($("input[name= crkbrd ]:checked").val() ==  Upload )
       { alert("Upload Your Own Ad"); }
    else if ($("input[name= crkbrd ]:checked").val() ==  Edit )
        { alert("Edit Your Ad Here"); }
    else
      { alert("You haven t chosen anything"); }
});

});
</script>
</head>
<body>
<input type="radio" id="rb1" name="crkbrd" value="Upload" /> Upload Your Own Ad<br />
<input type="radio" id="rb2" name="crkbrd" value="Edit" /> Edit Your Ad Here
</body>
</html>
最佳回答

IE与无线电台有灯塔,因为它在无线电台台被混淆之前,不会向变化事件火上。 而是使用点击事件。

Bug details:

Note this bug was established in IE9 (as long as You are conducted in standards Mode)

问题回答

我已在第8期、第2期和第3期浏览器上工作。

分配<条码> 是指无线电台的:

<input type="radio" id="rb1" name="crkbrd" value="Upload" class="myRadio" /> Upload Your Own Ad<br />
<input type="radio" id="rb2" name="crkbrd" value="Edit" class="myRadio" /> Edit Your Ad Here

之后使用:

 $( ".myRadio" ).change( function(){ 
    if ($(this).val() ==  Upload ) { 
       alert("Upload Your Own Ad"); 
    } else 
     if ($(this).val() ==  Edit ) { 
        alert("Edit Your Ad Here"); 
     } else { 
      alert("You haven t chosen anything");
     } 

 });




相关问题
getGridParam is not a function

The HTML: <a href="javascript:void(0)" id="m1">Get Selected id s</a> The Function: jQuery("#m1").click( function() { var s; s = jQuery("#list4").getGridParam( selarrrow )...

selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

jQuery cycle page with links

I am using the cycle plugin with pager functionality like this : $j( #homebox ) .cycle({ fx: fade , speed: fast , timeout: 9000, pager: #home-thumbs , ...

jquery ui dialog opens only once

I have a button that opens a dialog when clicked. The dialog displays a div that was hidden After I close the dialog by clicking the X icon, the dialog can t be opened again.

jConfirm with this existing code

I need help to use jConfirm with this existing code (php & Jquery & jAlert). function logout() { if (confirm("Do you really want to logout?")) window.location.href = "logout.php"; } ...

Wrap text after particular symbol with jQuery

What I m trying to do, is wrap text into div inside ll tag. It wouldn t be a problem, but I need to wrap text that appears particularly after "-" (minus) including "minus" itself. This is my html: &...

热门标签