私はphp、mysqlによって生成されたいくつかのテーブルを持つページを持っています。そして、私は各テーブル上で実行したいいくつかのjquery。ページ上のすべてのテーブルをカウントし、IDを取得して配列を実行します
私はテーブルのIDの配列を作成し、foreachでjqueryを実行するのが最善の方法だと考えています。
これはどのように行うのかわからないので、誰かがこれを行う方法について考えているなら、非常に感謝します。
EDIT ///これは私が各テーブル
$("#frontshade:radio").click(function() {
$(this).parent().children(":checkbox").attr('checked', false);
$(this)
.closest('table') // find the parent row
.find(":input[type='text']") // find text elements in that row
.attr('disabled','disabled') // disable them
.removeClass('disabled'); //Toggle class
$("#frontshade :checkbox").hide();
$("#frontshade .cbox").hide();
$(this).parent().children(":checkbox").show();
$(this).parent().children(".cbox").show();
});
$("#frontshade :checkbox").click(function(){
$(this)
.closest('tr') // find the parent row
.find(":input[type='text']") // find text elements in that row
.toggleDisabled()
.toggleClass('disabled','slow') // enable them
.end() // go back to the row
.siblings() // get its siblings
.find(":input[type='text']") // find text elements in those rows
.attr('disabled','disabled')
.removeClass('disabled'); // disable them
});
ありがとう、私はまだそれを実装するのに苦労して、私は元の投稿で実行したいコードを含めました。 –
コードを追加できますか?あなたのHTMLコードを含む。 @ http://jsfiddle.net/。そして、あなたがしたいことを正確に教えてください。私はあなたのためにそれを修正します! – PeeHaa
私に必要なのは、ループ内の現在のテーブルの一意のID $(「#のfrontshade:ラジオ」)と「#frontshade」を置換する方法を知っていることです(関数(){}をクリックし、 $( "#。 ); –