javascript - Get value from a link to display a <div> in the same page -
i have <table>
in research.php page that
| date | user| group | etc |
the column date
link. here sample of <table>
creation :
while($line= mysqli_fetch_array($warning)) { echo "<tr>"; echo"<td ><a href=\"\" onclick=\"javascript:visibilite('details'); return false;\">".date('d/m/y h:i:s', strtotime($line['date_heure']))."</a></td>";
the javascript code :
<script> function visibilite(thingid) { var targetelement; targetelement = document.getelementbyid(thingid) ; if (targetelement.style.display == "none") { targetelement.style.display = "" ; } else { targetelement.style.display = "none" ; } } </script>
and <div>
placed in same page:
<div id="details" style="display:none;">
everything work well. problem want div#details
change according date clicked. code hides div#details
display same informations. want able value clicked change div#details
according data in db. tried add in <a>
href='research.php?number=".$line['number']."'
nothing happens when click link.
i don't know if have use jquery , how, or if i'm doing wrong
if want display means using block
<script> function visibilite(thingid) { var targetelement; targetelement = document.getelementbyid(thingid) ; if (targetelement.style.display == "none") { targetelement.style.display = "block" ; } else { targetelement.style.display = "none" ; } } </script>
Comments
Post a Comment