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

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -