Phpjavascript: obtain the value after output div with echo

Source: Internet
Author: User
Phpjavascript: use echo to output div and get value // The above is to 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 !!


Reply to discussion (solution)

Alert (w. id) can be used, but w. value cannot be used .... What is the above reason?

Try w. getAttribute ("value ").

The. value attribute is for input. you cannot use p. if it is w. getAttribute ("value"), you can get the value of p.

You can change it.

 click

";echo "B: ".$row["b"];?>《script》function pop(w){ alert(w.getAttribute('value')); //alert(w.value);}《script》

Thank you!

Boss, how can we continue to hide the current p through js ??? Thank you!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.