php - open a div having id using onclick in a hyperlink -
below given div having id "panel" , links in same page outside div, when click on link div should open. there several links jquery not work , button created dynamically through php while loop hence cannot put unique id in hyperlink
<div id="panel"> <form name="userloginform" action="xxx.php" method="post"> <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center" class="tb"> <tr> <td align="left" valign="middle" height="80">user name</td> <td align="left" valign="middle">: </td> <td align="left" valign="middle"><input name="user" type="text" class="log"/></td> </tr> <tr> <td align="left" valign="middle">password</td> <td align="left" valign="middle">: </td> <td align="left" valign="middle"><input name="pass" type="password" class="log"/></td> </tr> <tr> <td> </td> <td> </td> <td> </td> </tr> <tr> <td colspan="3"><input name="submit1" type="submit" value="login" class="login_btn"/></td> </tr> </table> </form> </div>
and link is
<a href="#" id="flip" >launch now</a> <a href="#" id="" >launch now</a>
if not clear please reply part not clear can edit , provide useful information clearly
ok here link coming from, cms used here.
<?php $sql=mysql_query("select * heading order id desc"); while($r=mysql_fetch_array($sql)) { $ii=$r['id']; ?> <h3><?php echo $r['heading'];?></h3> <div> <div class="content"> <div class="main_table_wrapper"> <table width="1030" border="0" cellspacing="0" cellpadding="0" align="left"> <?php $sql2=mysql_query("select * inner_table head='$ii'") ; while($rows=mysql_fetch_array($sql2)) { $abc=str_replace($rows['url'],'xxxxxxxxxxxxxxx',$rows['url']); ?> <tr> <th align="left" valign="middle" width="350"><?php echo $rows['inner_names'];?></th> <th align="left" valign="middle" width="250"><?php echo $abc;?></th> <th align="left" valign="middle" width="200"><?php echo $rows['author'];?></th> <th align="center" valign="middle" width="100"><?php echo $rows['doe'];?></th> <th align="right" valign="middle" width="130"><span class="lunch"><a href="#" id="flip1">launch now</a></span></th> </tr> <?php } ?> </table> </div> </div> </div> <?php } ?> </div>
you can't have multiple elements same id.
since didn't show js code far, advice can give use class identifier action link.
from of markup use along $('span.lunch').on('click', 'a', function(e) { //do stuff } );
Comments
Post a Comment