English 中文(简体)
D. j里的电台投入问题
原标题:bind problems with radio input in jQuery
  • 时间:2011-09-30 10:42:58
  •  标签:
  • jquery

具有约束力的问题

摘自html代码

<table>
    <tr>
        <td haschildren="true"><input id="Grubbel_0" type="radio" name="Grubbel_0" value="0"></td>
        <td haschildren="true"><input id="Grubbel_1" type="radio" name="Grubbel_1" value="1"></td>
    </tr>
</table>

<img src="img.jpg" style="display:none;"/>

Some

<script language="javascript" type="text/javascript">
    $(document).ready(function () {

        // Check radiobuttons when clickin on a parent table cell
        $("td[haschildren= true ]").click(function () {
            $(this).find( input:radio ).attr( checked , true);
        });

        // What happens when a radiobutton is changed
        $( *[haschildren="true"] input:radio ).bind( change , function () {
            // This does not work when clicking the td boxes
        });
    });
</script>

捆绑(改动......)在我直接点击电台盒子时,而不是在我点击拖台时,虽然收听了无线电箱。

采用j Query 1.5.2.

Thanks

最佳回答

Try -

$(document).ready(function () {

    // Check radiobuttons when clickin on a parent table cell
    $("td[haschildren= true ]").click(function () {
        $(this).find( input:radio ).attr( checked , true).trigger( change );
    });

    // What happens when a radiobutton is changed
    $( *[haschildren="true"] input:radio ).bind( change , function () {
        // This does not work when clicking the td boxes
    });
});
问题回答

缩略语





相关问题
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: &...

热门标签