Originally I was using input with an id and grabbing it\'s value with getElementById. Currently, I\'m playing with if i click table name its shown all fields about table. i did table field to show. but i need to know click function. My Code: For input you must have used To get its text though, use: Again with getElementById, but instead .value, use .innerText Have you tried: If by 'td value' you mean text inside of td, then:s. How can I grab the values of the
$sql = "SHOW tables from database_name where tables_in_databasename not like '%tablename' and tables_in_databasename not like '%tablename%'";
$result=mysqli_query($cons,$sql);
$count = 0;
$array = array();
while ($row = mysqli_fetch_assoc($result)) {
$count++;
$tbody_txt .= '<tr>';
foreach ($row as $key => $value) {
if($count == '1') {
$thead_txt .='<td>'.$key.'</td>';
}
$tbody_txt .='<td>'.$value.'</td>';
$array[$key][] = $value;
}
}?>
value
to grab its text but for td, you should use innerHTML
to get its html/value. Example:alert(document.getElementById("td_id_here").innerHTML);
alert(document.getElementById("td_id_here").innerText);
.innerText
doesnt work in Firefox. .innerHTML
works in both the browsers.<td id="test">Chicken</td>
document.getElementById('test').innerText; //the value of this will be 'Chicken'
getElementbyId('ID_OF_ID').innerHTML
?document.getElementById('td-id').innerHTML