Phpjavascript: After the div is output with echo, the above value is obtained from the data. below is the output divecho & nbsp; & lt; div & nbsp; value $ row [xxx] & nbsp; onclickjavascript: & nbsp; p php javascript: use echo to output p and obtain value
// Read data from data
// Below is the output p
Echo"
";
Echo "B:". $ row ["B"];
?>
Script
Function pop (w ){
Alert (w. value );
}
Script
// Why is undefine ?????
// Thank you !!
------ Solution ----------------------
Try w. getAttribute ("value ").
------ Solution ----------------------
The. value attribute is for input. you cannot use p. if it is w. getAttribute ("value"), you can get the value of p.
------ Solution ----------------------
You can change it.
$row['xxx'] = 100;
$row['b'] = 1;
echo "click
";
echo "B: ".$row["b"];
?>
《script》
function pop(w){
alert(w.getAttribute('value'));
//alert(w.value);
}
《script》