0

Consider a table with 3 rows "ID" "Name" "phone-Number".

I am using PHP for connecting the UI with my SQL database.

the thing i want on my UI is ...

full IDs will b displayed on the page...

using jQuery Toggle function . When clicking on one of ID it should fetch information according to its value from data base and show Name and phone-Number down. Similarly by clicking the ID it should hide the content.

I have tried several ways but I am not getting it write. Can anyone help me out with this.

This is my PHP code.

http://snipsave.com/user/profile/karthikeyan#5351

I used jQuery for toggling but when I click on button it hides all other data and vice versa.

4

1 回答 1

0

删除它<button id="hide">Hide</button>
并使用...

$(document).ready(function(){
  $("#show").click(function(e) {
    e.preventDefault();
    var i = $(this).next("i:first");
    i.toggle();
    $(this).text( ( i.is(":visible") ) ? "Hide" : "Show" );
  });
});

我建议你使用class而不是id

于 2013-06-23T09:41:37.193 回答