php - How to get value of dynamically generated table using javascript -
here trying value inside <td> value </td> using javascript getelementbyid(id); not able fetch value , display value in alert box.
code:
<script type="text/javascript"> function getvalue() { var lat = document.getelementbyid('lat').value; var lon = document.getelementbyid('lon').value; var lati = parseint(lat); var long = parseint(lon); alert(lati,long); } </script> php-html code:
while($row = mysql_fetch_assoc($retval)) { echo "<tr>"; echo "<td>" . $row['id'] . "</td>"; echo "<td>" . $row['theater_name'] . "</td>"; echo "<td>" . $row['address'] . "</td>"; echo "<td id='lat'>" . $row['lat'] . "</td>"; echo "<td id='lon'>" . $row['lon'] . "</td>"; echo "</tr>"; } the table auto generated php database table values 1 record. want fetch lat , lon value in javascript , alert it.. not able alert...how can this?
var lat = document.getelementbyid('lat').innerhtml; var lon = document.getelementbyid('lon').innerhtml; value <form>s elements(<input>, <select> etc').
Comments
Post a Comment